Andrew Douglas Pitonyak <[EMAIL PROTECTED]> skrev den Sat, 16 Apr 2005 18:17:42 +0000:

Johnny Andersson wrote:

...is it possible? If so, how?

You can cause a macro to be called from a dialog by an event. You can not directly add arguments of your choice, so the usual solution is to call the event handler, and then have the event handler call the desired macro with the appropriate arguments. When I did this, I would go back to the dialog and obtain the desired values and then use them.



I'm not sure what you mean by "event handler", but I guess I could find that out.


Let's say a have a macro like this:

Sub MyMacro (MyArgument As String)
        Dim MyBlahblah As Object
        ' and so on...
        .
        .
        .
        .
End Sub

Since a control element in a dialog doesn't seem to be able to send arguments to a macro, I just write another macro which the control element calls instead of the original one, like this:

Sub MyMacroCaller
        Call MyMacro("Hey man!")
End Sub

This is not a good looking solution, but it works.

Can you tell me more about the event handler? How do I call it? Or where can I learn more about it?


-- Johnny

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to