Cedric D
asked on
Cannot Run Macro from script
Hello,
I am trying to run the script (see attached file), however after I press "ALT+F11" in Outlook then copy/paste and run my script I'm getting an error "Compile error: invalid outside procedure".
Please tell me what am I doing wrong, sorry I'm very new to run macros via Visual Basic Editor.
Export-Folder-Structure-VBS.txt
I am trying to run the script (see attached file), however after I press "ALT+F11" in Outlook then copy/paste and run my script I'm getting an error "Compile error: invalid outside procedure".
Please tell me what am I doing wrong, sorry I'm very new to run macros via Visual Basic Editor.
Export-Folder-Structure-VBS.txt
ASKER
Not sure how this script will work, would you please give me more details. I have removed these 2 functions and still getting the same issue.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This works.
Open in new window
These 2 functions (or procedures) call are in the global scope, and as the error say, you can only call functions (or procedures) within functions (or procedures)Side notes:
Global scope is evil, try to avoid it.