The information in this article applies to:
SUMMARYIn Microsoft Excel version 5.0 for Windows, it is not possible to use built- in constants, such as xlNormal, xlMinimized, or xlMaximized, for the "windowstyle" argument of the Visual Basic Shell function. This behavior is by design. MORE INFORMATIONThe Visual Basic Shell function is used to run an executable program from a Visual Basic subroutine. Here is an example of the Shell function that will run the Microsoft Windows Notepad program in a normal window with focus:
The second argument (in this case, 1) is the windowstyle argument of the
function. Valid windowstyle values are as follows:
The windowstyle you specify determines how the application's window
will appear when it is started.
It is not possible to use built-in constants such as xlNormal, xlMinimized, or xlMaximized in place of the standard numerical values shown here. This is because the values of the built-in constants are not valid when applied to the Shell command. The values of the various built-in constants that might be expected to work as windowstyle arguments are as follows:
If you try to use a built-in constant for the windowstyle argument,
you will receive the following error message:
Steps to Reproduce BehaviorMicrosoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose. Note that a line that is preceded by an apostrophe introduces a comment in the code--comments are provided to explain what the code is doing at a particular point in the procedure. Note also that an underscore character (_) indicates that code continues from one line to the next. You can type lines that contain this character as one logical line or you can divide the lines of code and include the line continuation character. For more information about Visual Basic for Applications programming style, see the "Programming Style in This Manual" section in the "Document Conventions" section of the "Visual Basic User's Guide."The following examples illustrate proper, and improper, use of the windowstyle argument in the Shell function.
REFERENCESFor more information on the Shell function, choose the Search button in Visual Basic Help and type: Shell Additional query words: 5.00c
Keywords : kbprg |
Last Reviewed: October 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |