OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

CALC: Sheet - removeByIndex does not work

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Fen1x
Newbie
Newbie


Joined: 22 Mar 2012
Posts: 3

PostPosted: Thu Mar 22, 2012 11:02 am    Post subject: CALC: Sheet - removeByIndex does not work Reply with quote

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
View user's profile Send private message
karolus
OOo Advocate
OOo Advocate


Joined: 22 Jun 2011
Posts: 210

PostPosted: Thu Mar 22, 2012 11:21 am    Post subject: Reply with quote

Hi
There is no Method ...removeByIndex( )...try .removeByName( doc.sheets( 0 ).Name )

Karo
Back to top
View user's profile Send private message
Fen1x
Newbie
Newbie


Joined: 22 Mar 2012
Posts: 3

PostPosted: Thu Mar 22, 2012 11:23 am    Post subject: Reply with quote

Thanks a lot, now it works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group