LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Running a Batch file from VBA

I am trying to run a batch file from Excell 2003 using the Shell function in
VBA and I cant seem to get it to work. The code is like this:

RetVal = Shell(BatFilePath, vbNormalFocus)

Where BatFilePath is a string variable with the full path of the batch file
(e.g., D:\...\Batchfile.bat)

The line executes €“ I get a value in the RetVal variable and I see a brief
flash of the command prompt window, but I do not see the file that the batch
file is supposed to produce. A search of my hard drives indicates that the
results have not been created in some unexpected location.

The batch file works properly when run manually.

 
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
batch file call from a macro - how ? and required batch format VB-rookie Excel Programming 4 September 6th 08 12:52 AM
running a batch file Mohan[_2_] Excel Programming 3 April 10th 04 10:48 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 11:27 AM.

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

About Us

"It's about Microsoft Excel"