Running a DOS Batch File, running a Word macro, trying to run a DOS batch file
Posted on 2010-11-24
I am using a DOS batch file to run a Word macro i.e. in the batch file - mybatch.bat is the command line:
winword /mMyMacro /t DocumentName.docm
Where DocumentName.docm is my Word document containing the macro and MyMacro is the macro that initiates the process I want to run.
Contained within the process is a subroutine that creates a batch file to process a FTP statement to upload documents to a website. The batch file is executed within the macro using the code:
dRetVal = Shell(Batch_Filename, 0)
Where Batch_Filename is the batch file created by the macro.
This works if the MyMacro macro is initiated by opening up the DocumentName.docm and running the MyMacro macro, but does work if initiated from a batch file, i.e. it will not allow a batch file to be run from within a batch file.
Does anyone have a workaround for this? If I was doing it manually I would "call" the second batch file.