Connecting Tech Pros Worldwide Help | Site Map

Command bar OnAction

G.Gerard
Guest
 
Posts: n/a
#1: Nov 12 '05
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





Albert D. Kallal
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Command bar OnAction


Try the follwing:

=MyFunction("Hello Albert")

The above should work.


--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
kallal@msn.com
http://www.attcanada.net/~kallal.msn


Closed Thread