Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trevor,
Shell ("myDir\myFile.bat") Make sure vba is in the right current drive to run the file (use ChDrive myDrive to change to the drive that contains the .bat file). Also note that Shell commands run asynchronously, so if you need the results of the .bat operation for a subsequent vba operation, it's possible to have timing problems, i.e., the .bat operation has to finish before you get to the vba command that uses the .bat results. HTH, Shockley "Trevor" wrote in message ... Hello all, I am wondering if it is possible to run a .BAT file from within a macro in excel. Basically, the .BAT file "creates" the text file that my macro imports. I want, as the first step in the macro, to run the .BAT file and then continue with the text import. As it is now, I have to leave excel, manually run the .BAT file, and then run the macro to import the text file. Any suggestions would be greatly appreciated. Thanks, Trevor |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running macro on file open | Excel Discussion (Misc queries) | |||
How to CANCEL file SAVE PROMPT when MACRO is running? | Excel Discussion (Misc queries) | |||
How to stop getting the file save box when running a macro | Excel Discussion (Misc queries) | |||
Running a macro before saving file | Excel Programming | |||
Problem running macro from add-in (xla-file) in a shared workbook. | Excel Programming |