Jim Horn
asked on
Shell statement returns error 5 "Invalid procedure call or argument"
Hello all
The following lines return an "Invalid procedure call or argument" runtime error #5, and I have no idea why:
sShellPath = chr(34) & "c:\Windows\Notepad.exe " & sDestinationPath & chr(34)
dbl = Shell(sShellPath, vbMaximizedFocus)
sDestinationPath is a valid path/file, sShellPath is a string, Notepad is at the above path, and dbl is a double.
I also tried this referencing Wordpad, and the file at sDestinationPath is not read-only.
I'm using Windows XP SP2/Access XP.
Thanks in advance.
-Jim
The following lines return an "Invalid procedure call or argument" runtime error #5, and I have no idea why:
sShellPath = chr(34) & "c:\Windows\Notepad.exe " & sDestinationPath & chr(34)
dbl = Shell(sShellPath, vbMaximizedFocus)
sDestinationPath is a valid path/file, sShellPath is a string, Notepad is at the above path, and dbl is a double.
I also tried this referencing Wordpad, and the file at sDestinationPath is not read-only.
I'm using Windows XP SP2/Access XP.
Thanks in advance.
-Jim
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You just had the " (chr(34)'s) in the wrong spot
Also, you dont need to pass the win dorectory to it either... You may have had issues if you moved your app to a different V of Windows (Win2K = c:\winnt\)
Take care mate!
Dave
Also, you dont need to pass the win dorectory to it either... You may have had issues if you moved your app to a different V of Windows (Win2K = c:\winnt\)
Take care mate!
Dave
ASKER