Command bar OnAction

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • G.Gerard

    Command bar OnAction

    Hello

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

    Example: Public Sub MyFunction(strM sg 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

    #2
    Re: Command bar OnAction

    Try the follwing:

    =MyFunction("He llo Albert")

    The above should work.


    --
    Albert D. Kallal (MVP)
    Edmonton, Alberta Canada
    kallal@msn.com



    Comment

    Working...