Note The function, method, object, or property described in this topic is disabled if the Microsoft Jet Expression Service is running in sandbox mode, which prevents the evaluation of potentially unsafe expressions. For more information on sandbox mode, search for "sandbox mode" in Help.
Returns the argument portion of the command line used to launch Microsoft Visual Basic or an executable program developed with Visual Basic. The Visual Basic Command function is not available in Microsoft Office applications.
Syntax
Command
Remarks
When Visual Basic is launched from the command line, any portion of the command line that follows /cmd
is passed to the program as the command-line argument. In the following example, cmdlineargs
represents the argument information returned by the Command function.
VB /cmd cmdlineargs
For applications developed with Visual Basic and compiled to an .exe file, Command returns any arguments that appear after the name of the application on the command line. For example:
MyApp cmdlineargs
To find how command line arguments can be changed in the user interface of the application you're using, search Help for "command line arguments."