PC Review


Reply
Thread Tools Rate Thread

batch file call from a macro - how ? and required batch format

 
 
VB-rookie
Guest
Posts: n/a
 
      5th Sep 2008
Hi
Im trying to run a batch file (runit.bat) that contains the following
statements:

runfast.exe <temp.in
interpolate.exe
summit.exe
del int.log
del old.out

..exe are fortran files.

I just saved this text file with these statements to a file named runit.bat.
If I double click on the file - it will execute these sequentially as shown.

Im trying to run in excel from a macro. I tried putting this in a call
statement but it just flashes the DOS window real quick , doesnt run.

I can call an individual program, say runfast.exe, and it runs ok. If I try
to call runfast.exe by itself from within a batch file, it doesnt run either,
so its not just because I have a sequence of executable statements.

Im in XP, does a batch file need a special format or something to run from
excel 2003?

Please note my name - Im a primative VB user who likes the record button.
Thanks for your time.


 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      5th Sep 2008
Try

Shell ("C:\runnit.bat")

Mike

"VB-rookie" wrote:

> Hi
> Im trying to run a batch file (runit.bat) that contains the following
> statements:
>
> runfast.exe <temp.in
> interpolate.exe
> summit.exe
> del int.log
> del old.out
>
> .exe are fortran files.
>
> I just saved this text file with these statements to a file named runit.bat.
> If I double click on the file - it will execute these sequentially as shown.
>
> Im trying to run in excel from a macro. I tried putting this in a call
> statement but it just flashes the DOS window real quick , doesnt run.
>
> I can call an individual program, say runfast.exe, and it runs ok. If I try
> to call runfast.exe by itself from within a batch file, it doesnt run either,
> so its not just because I have a sequence of executable statements.
>
> Im in XP, does a batch file need a special format or something to run from
> excel 2003?
>
> Please note my name - Im a primative VB user who likes the record button.
> Thanks for your time.
>
>

 
Reply With Quote
 
Barb Reinhardt
Guest
Posts: n/a
 
      5th Sep 2008
I'd be willing to bet that this would work

http://www.mvps.org/access/general/gen0015.htm
--
HTH,
Barb Reinhardt




"VB-rookie" wrote:

> Hi
> Im trying to run a batch file (runit.bat) that contains the following
> statements:
>
> runfast.exe <temp.in
> interpolate.exe
> summit.exe
> del int.log
> del old.out
>
> .exe are fortran files.
>
> I just saved this text file with these statements to a file named runit.bat.
> If I double click on the file - it will execute these sequentially as shown.
>
> Im trying to run in excel from a macro. I tried putting this in a call
> statement but it just flashes the DOS window real quick , doesnt run.
>
> I can call an individual program, say runfast.exe, and it runs ok. If I try
> to call runfast.exe by itself from within a batch file, it doesnt run either,
> so its not just because I have a sequence of executable statements.
>
> Im in XP, does a batch file need a special format or something to run from
> excel 2003?
>
> Please note my name - Im a primative VB user who likes the record button.
> Thanks for your time.
>
>

 
Reply With Quote
 
VB-rookie
Guest
Posts: n/a
 
      5th Sep 2008

This still doesnt work, but it explained to me what the "/c" does in the
call command. If I omit that, it leaves the DOS window open. It shows Im
in My Documents folder, which I guess is my default, but this is not where
the program is, even though I called out the complete path to the program in
the call statement. I need to figure out how to direct it to the proper
directory.

This helped some Barb thank you.

"Barb Reinhardt" wrote:

> I'd be willing to bet that this would work
>
> http://www.mvps.org/access/general/gen0015.htm
> --
> HTH,
> Barb Reinhardt
>
>
>
>
> "VB-rookie" wrote:
>
> > Hi
> > Im trying to run a batch file (runit.bat) that contains the following
> > statements:
> >
> > runfast.exe <temp.in
> > interpolate.exe
> > summit.exe
> > del int.log
> > del old.out
> >
> > .exe are fortran files.
> >
> > I just saved this text file with these statements to a file named runit.bat.
> > If I double click on the file - it will execute these sequentially as shown.
> >
> > Im trying to run in excel from a macro. I tried putting this in a call
> > statement but it just flashes the DOS window real quick , doesnt run.
> >
> > I can call an individual program, say runfast.exe, and it runs ok. If I try
> > to call runfast.exe by itself from within a batch file, it doesnt run either,
> > so its not just because I have a sequence of executable statements.
> >
> > Im in XP, does a batch file need a special format or something to run from
> > excel 2003?
> >
> > Please note my name - Im a primative VB user who likes the record button.
> > Thanks for your time.
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a batch file from an Excel Macro =?Utf-8?B?QWxleCBIb3Jhbg==?= Microsoft Excel Misc 0 2nd Mar 2006 03:29 PM
RE: Call a batch file from an Excel Macro =?Utf-8?B?R2FyeScncyBTdHVkZW50?= Microsoft Excel Misc 0 2nd Mar 2006 03:26 PM
RE: Help To Create Batch/Macro Required Keith Duong Microsoft Excel Programming 2 22nd Jan 2005 02:16 PM
RE: Help To Create Batch/Macro Required Keith Duong Windows XP General 2 22nd Jan 2005 02:16 PM
RE: Help To Create Batch/Macro Required Keith Duong Windows XP Help 2 22nd Jan 2005 02:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 AM.