Quote:
Originally Posted by Guessed
As a public variable, its value will persist but you do need to run the macro to give it a value first. So you should rename the setProjectPath macro to Document_Open or Document_New as these will autorun with either opening an existing document or creating a new document respectively.
Alternatively, you could declare it as a constant.
|
I tried the constant route, adding
Code:
Public Const projectPath As String = "myURL"
but I receive an error that says "Constants, fixed-length strings, arrays, user-defined types, and Declare statements not allowed as Public members of object modules."
For what it's worth, I also tried the two methods for Document variable, but they too ddi not seem to set/persist.