XL5 Docerr: Shell Function Pathname and Windowstyle Parts |
In Microsoft Excel, Visual Basic Help contains incorrect information about the pathname and windowstyle parts of the Shell function.
Shell ("c:\excel\network.txt")
-and-
Shell ("c:\winword\sample.doc")The shell function cannot launch another program if the name of a file associated with that program is passed to the shell function. If the pathname argument is the name of a document, not the name of an application, you will receive the error message
To work around this situation, include the name of the application. as in the following examples:Run-time error '5':
Invalid procedure call
Shell ("notepad.exe c:\excel\network.txt")
-or-
Shell ("c:\winword\winword.exe c:\winword\sample.doc")
RetVal = Shell ("c:\windows\calc.exe", 2)but this command will not:
Shell ("c:\windows\calc.exe", 2)If you attempt to enter this second line, you will receive the error message "Expected: )" and the comma in the command will be highlighted.
To find the Shell Function in Help, choose the Search button in Visual Basic Help and type:
Shell
Keywords :
Version : 5.00 5.00c 7.00
Platform : WINDOWS
Issue type :
Technology :
|
Last Reviewed: April 12, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |