P
Paul
I'm trying to write code to open Windows Explorer to a designated folder.
The code I've got so far opens Win Explorer as long as the directory path is
hard-wired in the code such as:
ShellID = Shell("Explorer.exe M:\Apps", vbNormalFocus)
But when I try to use a variable to designate the path, such as
strPath = "M:\Apps"
ShellID = Shell("Explorer.exe strPath", vbNormalFocus),
I get an error message saying
The path 'strPath' does not exist or is not a directory.
Since the code opens Windows Explorer just fine when the directory path is
hard wired without using the variable strPath, the problem is with my
syntax.
What change can I make to the syntax I'm using so that the code will open
Win Explorer when I use a variable for the directory path?
Thanks in advance,
Paul
The code I've got so far opens Win Explorer as long as the directory path is
hard-wired in the code such as:
ShellID = Shell("Explorer.exe M:\Apps", vbNormalFocus)
But when I try to use a variable to designate the path, such as
strPath = "M:\Apps"
ShellID = Shell("Explorer.exe strPath", vbNormalFocus),
I get an error message saying
The path 'strPath' does not exist or is not a directory.
Since the code opens Windows Explorer just fine when the directory path is
hard wired without using the variable strPath, the problem is with my
syntax.
What change can I make to the syntax I'm using so that the code will open
Win Explorer when I use a variable for the directory path?
Thanks in advance,
Paul