I want to store a path in string “path” which would be available for the whole workbook.
When I do it the following way, I get an error:
“invalid outside procedure”
Here is how I am trying to declare the path in (General) (Declaration)
Option Explicit
Dim path As String
path = "\\sharedDrive\TestFolder\Test_PDF\"
I get the error at:
"\\sharedDrive\TestFolder\Test_PDF\"
Put the variable in a module instead, like this:
Then, in your Workbook_Open routine:
To access it anywhere, use
yourModule.path.