| View previous topic :: View next topic |
| Author |
Message |
Fen1x Newbie

Joined: 22 Mar 2012 Posts: 3
|
Posted: Thu Mar 22, 2012 11:02 am Post subject: CALC: Sheet - removeByIndex does not work |
|
|
Maybe i did get something wrong, but when i try to use this code | Code: | Sub ctns
Dim Doc As Object
Dim Sheet As Object
Dim i As Integer
Doc = ThisComponent
Sheet = Doc.getSheets()
Doc.Sheets.removeByIndex(0)
End Sub | i get an error, whic says "Property or method not found: removeByIndex"
Is it a bug? I'm using OO 3.2.1
PS: can you suggest any other method of deleting spreadsheets in macros by index?
Moderation probe1: moved to MACROS AND API section, where all macro related questions belong to; edited subject |
|
| Back to top |
|
 |
karolus OOo Advocate

Joined: 22 Jun 2011 Posts: 208
|
Posted: Thu Mar 22, 2012 11:21 am Post subject: |
|
|
Hi
There is no Method ...removeByIndex( )...try .removeByName( doc.sheets( 0 ).Name )
Karo |
|
| Back to top |
|
 |
Fen1x Newbie

Joined: 22 Mar 2012 Posts: 3
|
Posted: Thu Mar 22, 2012 11:23 am Post subject: |
|
|
| Thanks a lot, now it works. |
|
| Back to top |
|
 |
|