Vba Shell mspaint.exe Company
Use the Shell function directly and use explorer.exe to open the folder. The code is as follows: subhhowdir () shell "explorer. Exed: \ dir ",vbnormalfocusendsub has the following functions: the shell function indicates to run the executable program, and returns a Variant(Double) indicating the program task ID if it succeeds, otherwise it returns zero. Syntax shell (pathname [,window style]) shell function syntax has the following named parameters: components indicate that pathname is required; Variable (string). The name of the program to be executed and any necessary parameters or command line switches; This may include directories or folders and drives. In Macintosh, you can use the MacID function to specify the signature of the application instead of the name. The following example uses the signature of MicrosoftWord: ShellMACID ("MSWD") Window Style is optional. Variant (integer), corresponding to the style of the window where you want to run the program. If windowstyle is omitted, the program will start and be minimized, but it will get focus. In Macintosh(System7.0 or later), windowstyle only determines whether the application has focus at runtime. The windowstyle naming parameter has the following values: a constant value indicates that vbHide 0 hides the window and passes the focus to the hidden window. The vbHide constant does not apply to Macintosh platforms. The vbNormalFocus 1 window gets focus and returns to its original size and position. The vbMinimizedFocus2 window is displayed as an icon with focus. The vbMaximizedFocus3 window is maximized and has focus. The vbNormalNoFocus4 window is restored to the nearest size and position. The currently active window remains active. The vbMinimizedNoFocus6 window is displayed as an icon. The currently active window remains active. Note If the Shell function successfully executes the specified file, it will return the task ID of the started program. The task ID is a unique number that identifies the running program. If the Shell function cannot start the specified program, an error will occur. In Macintosh, vbNormalFocus, vbminizedfocus and vbMaximizedFocus all put applications in the foreground; VbHide, vbNoFocus and vbMinimizeFocus all put applications in the background.