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

help with simple macro

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
selijah
General User
General User


Joined: 26 Aug 2004
Posts: 10

PostPosted: Mon Dec 13, 2004 5:58 pm    Post subject: help with simple macro Reply with quote

I am trying the following from the StarOffice basic book and it does not work:

Sub Main
Macro1
End Sub

Sub Macro1
Dim Doc As Object
Dim Sheet As Object
Doc = StarDesktop.CurrentComponent
Sheet = Doc. Sheets (0)
msgbox("jfj")
End Sub

the error is on : Sheet = Doc. Sheets (0)

it does not find the method.
pls help.
Back to top
View user's profile Send private message
r_vinoya
Super User
Super User


Joined: 03 Dec 2003
Posts: 619
Location: Somewhere in the Philippines

PostPosted: Mon Dec 13, 2004 7:47 pm    Post subject: Re: help with simple macro Reply with quote

selijah wrote:
I am trying the following from the StarOffice basic book and it does not work:

Sub Main
Macro1
End Sub

Sub Macro1
Dim Doc As Object
Dim Sheet As Object
Doc = StarDesktop.CurrentComponent
Sheet = Doc. Sheets (0)
msgbox("jfj")
End Sub

the error is on : Sheet = Doc. Sheets (0)

it does not find the method.
pls help.


Try Replacing StarDesktop.CurrentComponent by Thiscomponent
Ex.
Doc = Thiscomponent

I have no explanations.
I experience the same problem as yours when I was just starting. Wink
_________________
# : - )
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 Calc 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