Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Bear with me here.
I created a button that is enabled when the count on a primary key is 1. I've built a 'Run Macro' action to generate an email containing the data associated with the selected primary key.
When I'm in the Edit Module window I can press 'Test' repeatedly and the emails will fire successfully. When I press the button the email will fire successfully...ONCE. After pressing the button all subsequent attempts to fire an email from within the Edit Module window or via the button fail. I don't get any error messages.
When no emails are firing, if I modify the script (even by just adding a space) the Test button will once again fire emails repeatedly and the button will work ONCE. Again, all subsequent attempts fail.
Can someone point me in the right direction here? Why does the button only work one time then completely disable the script?
Thanks in advance,
Mick
When you make changes to the doc, VBS variables in the module are reinitialized. It sounds like you may be using some gobal variables (defined outside a sub) that are relying on that initaliztion. So perhaps your macro leaves them in a non-reusable state. If that't the case, look to reinitializing them on each call.
-Rob
When you make changes to the doc, VBS variables in the module are reinitialized. It sounds like you may be using some gobal variables (defined outside a sub) that are relying on that initaliztion. So perhaps your macro leaves them in a non-reusable state. If that't the case, look to reinitializing them on each call.
-Rob
Beautiful. I just converted my script to a sub and all is well. Thanks!!