By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,939 Members | 611 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,939 IT Pros & Developers. It's quick & easy.

Command bar OnAction

P: n/a
Hello

Does anyone know how to write a function name with arguments in the OnAction
of a command
bar button:

Example: Public Sub MyFunction(strMsg as String)

Msgbox strMsg

End Sub

Now if I write ( MyFunction "This is the message" ) in the OnAction of a
command bar button I get
this error :

can't run the macro or callback function 'MyFunction
"This is the message"'

If a function doesn't have any arguments, simply writing the function name
in the OnAction works well but when
arguments are involved I can't call the function from a command bar button.

Am I using the wrong brackets of quotation marks or something ?

Thanks
G.Gerard

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try the follwing:

=MyFunction("Hello Albert")

The above should work.
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
ka****@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.