|
-
Jun 10th, 2003, 10:27 PM
#1
Fanatic Member
The Shell function parameter "pathname" takes an argument list separated by spaces (who knows why, but it does). The first argument is the application, the following arguments are the files to be opened by the application (separated by spaces, remember). So if the path name includes spaces, you must enclose the path name with double quotes. You can add double quotes inside a quotation by using two consecutive double quotes (""). So the code would be:
VB Code:
Shell """C:\excellfolder\excel.exe"" ""C:\example folder\example.xls""", 1
Note that it is the same code with "" around each path name. (It isn't necessary for the application file path because it doesn't have spaces, but might as wel be consistenet.)
Of course, that doesn't mean that it wouldn't be better to use ShellExecute, it is just what you need to do if you want to use the Shell function.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|