Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I wrote vbscript macro that export data to excel.
When running the macro from the "edit module" screen (by clicking on the "Test" button") it works.
I'm trying to call my function from the loading script.
I tried to write the macro as a procedure (with SUB, END SUB) and call from script with "CALL" - but it throws "script line error" message.
I tried to write the macro as a function (with Function, END Function) and call from script with SET var = MyFunc() or with LOAD MyFunc(), but no data was exported.
How should I call my macro? Does there is any security issue?
I read all discussions about this issue and tried to do everything but it still doesn't work...
Can someone please advise? thanks!!!
have you tried with button and trigger,
create a button and add action on button, "run a macro" an see if it works...
During the load it didn't exist the ActiveDocument and all methods which needs this basic-point will fail. Instead you could use a PostReload-Trigger.
- Marcus
Your function method should work.
One example:
using this module / vbs-function:
hope this helps
regards
Marco
Hi,
Check this there is an example in this link
Calling VB function (macro) in Load script to find common string length in two strings
Regards,
Jagan.
Thank you all for your help!!!! I used Marcus_Sommer suggestion (PostReload-Trigger) and it's working!
please mark your thread as answered.
thanks
regards
Marco