Is there a way to create or retrieve and modify a DOS batch file and then run it using VBA? Thanks. If so, I'd appreciate a simple example of the code.
Printable View
Is there a way to create or retrieve and modify a DOS batch file and then run it using VBA? Thanks. If so, I'd appreciate a simple example of the code.
Modifying a batch file is as simple as editing a text file. Search the forums on how to work with text files.
To run it use this code
Note: /c closes the DOS prompt when finishedCode:Call Shell(Environ$("COMSPEC") & " /c C:\MyFile.bat", vbNormalFocus)
Hope this helps...