ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   running a batch file (https://www.excelbanter.com/excel-programming/294770-running-batch-file.html)

Mohan[_2_]

running a batch file
 
Is there a way to run a batch file (dos command file) from
vba code?

To upgrade the existing Excel application, I need to put
some dll in the local drive.. I have a batch file to copy
this from the network to local drive..

Is there a way I can run this batch file in the Excel
Auto_Open module?

Thank you

Dave Peterson[_3_]

running a batch file
 
Take a look at Shell in VBA's help.

But maybe better would be looking at FileCopy in the help.

Then you may not even need that .bat file.


Mohan wrote:

Is there a way to run a batch file (dos command file) from
vba code?

To upgrade the existing Excel application, I need to put
some dll in the local drive.. I have a batch file to copy
this from the network to local drive..

Is there a way I can run this batch file in the Excel
Auto_Open module?

Thank you


--

Dave Peterson


Tom Ogilvy

running a batch file
 
Look in VBA help as the Shell command.

--
Regards,
Tom Ogilvy

"Mohan" wrote in message
...
Is there a way to run a batch file (dos command file) from
vba code?

To upgrade the existing Excel application, I need to put
some dll in the local drive.. I have a batch file to copy
this from the network to local drive..

Is there a way I can run this batch file in the Excel
Auto_Open module?

Thank you




Rob van Gelder[_4_]

running a batch file
 
Shell is your answer.

The trouble is, Shell will set the batch file to run, but then immediately
continue VBA code execution.
So if your code straight after the Shell command relies on what actions of
the batch file, then you could run into problems because the batch file may
or may not have finished.

Do an internet search for ShellWait if the above is an issue for you.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Mohan" wrote in message
...
Is there a way to run a batch file (dos command file) from
vba code?

To upgrade the existing Excel application, I need to put
some dll in the local drive.. I have a batch file to copy
this from the network to local drive..

Is there a way I can run this batch file in the Excel
Auto_Open module?

Thank you





All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com