on 2011 Dec 16 1:41 AM
I want to add a macro to run on after expantion. The help give the following syntax
AFTER_EXPAND(Argument As String)
MsgBox Argument
AFTER_EXPAND = True
End Function
Many of the MNU commands appear to be intended to run from a button.
The AFTER_EXPAND appears to be event driven. I want to execute some code after the expansion event. I assume I put my code into the function above. Where do I put the function to ensure it gets executed? I tried adding it to sheet 1 (data cache) and the VBA came p as invalid syntax
I added the word "function" to the start and the error went away but there is no evidence the macro is invoked when I expand my schedule.
I need guidance getting started.
Thanks
Cliff
Create a module in VBA and just place this function with code there . Then AFTER_EXPAND definitely gets triggered. For testing ,just try simple code first.
AFTER_EXPAND(Argument As String)
MsgBox " AFTER_EXPAND is triggered"
AFTER_EXPAND = True
End Function
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have my answer. P Krishnas was helpful but already knew how to display my own message and that was how i knew the code was not being invoked. There were two things I was missing;
The first thing was I had to preceed the first line of code with the word "function". The help (for version 7) missed this key word
The second was I had to put the code in a module rather than in Sheet 1.
As soon as I moved it there
Cheers
Cliff
User | Count |
---|---|
8 | |
5 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.