First time here? Check out the FAQ!
asked 2012-04-23 22:59:56 +0200Max74
I need a macro that check if a sheet exists by its index instead of its name
oSheets = ThisComponent.Sheets()
If oSheets.hasByName("Invoice") Then
Instead I need something like this (that obviously doesn't work):
If oSheets.hasByIndex(2) Then
Anyone can help me?
Sub Main target=2 rem looking for sheet number 2 (not sheet index 2) oSheets=ThisComponent.Sheets() i=oSheets.getcount() rem i is the number of sheets if (i >= target) then msgbox "Found it" else msgbox "Not found" end if End Sub
LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!
Asked: 2012-04-23 22:59:56 +0200
Seen: 363 times
Last updated: Apr 25 '12