Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Would Like to Automate Batch File Creation and Text FIle Import socrtwo Excel Discussion (Misc queries) 2 August 18th 06 03:54 PM
Hide Excel session when running at the batch mode xiaoxshi Excel Discussion (Misc queries) 1 July 23rd 06 03:54 PM
Running Excel as a batch job AND in the background GB[_3_] Excel Programming 0 August 30th 03 01:08 PM
Running a batch file from VB Graham Carter Excel Programming 3 August 29th 03 04:18 PM
Running a batch file from Excel VBA verizon Excel Programming 1 July 20th 03 09:27 AM


All times are GMT +1. The time now is 03:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"