Hi,
How would I go about referencing windows explorer in VBA for a multi operating system environment? The problem being that explorer lives in C:\WINNT\ on Win2K and in C:\WINDOWS on WinXP.
The code I am currently using is:
Private Sub CmdOpenBrochureDir_Click()
On Error GoTo Err_CmdOpenBrochureDir_Click
Dim stAppName As String
stAppName = "C:\WINDOWS\explorer.exe S:\DirectoryName"
Call Shell(stAppName, 1)
Exit_CmdOpenBrochureDir_Click:
Exit Sub
Err_CmdOpenBrochureDir_Click:
MsgBox err.Description
Resume Exit_CmdOpenBrochureDir_Click
End Sub
I've tried replacing C:\WINDOWS\explorer.exe with, %SystemRoot%\explorer.exe, but it says file not found.
Any ideas?
Thanks
How would I go about referencing windows explorer in VBA for a multi operating system environment? The problem being that explorer lives in C:\WINNT\ on Win2K and in C:\WINDOWS on WinXP.
The code I am currently using is:
Private Sub CmdOpenBrochureDir_Click()
On Error GoTo Err_CmdOpenBrochureDir_Click
Dim stAppName As String
stAppName = "C:\WINDOWS\explorer.exe S:\DirectoryName"
Call Shell(stAppName, 1)
Exit_CmdOpenBrochureDir_Click:
Exit Sub
Err_CmdOpenBrochureDir_Click:
MsgBox err.Description
Resume Exit_CmdOpenBrochureDir_Click
End Sub
I've tried replacing C:\WINDOWS\explorer.exe with, %SystemRoot%\explorer.exe, but it says file not found.
Any ideas?
Thanks