Launching a DOS box from VBA

  • Thread starter David Dalebroux
  • Start date
D

David Dalebroux

Windows 98, Excel 2002. Haven't a clue if this is possible!

As it stands now, a legacy DOS program runs its course in a window,
then the window closes when it's done.

I am in the process of eliminating this program. There is quite a bit
of data, and I can only retrieve one item at a time without having to
restart the DOS program.

1) Can I start a DOS Window from VBA...
2) ...and if so, can I check to see the state of the DOS window (ie,
is it active, does it have the focus, is still open, even is it
minimized, and even ensure there's only one instance running)?

No need to answer this next part, but if I am asking a simple question
in the first place....

What I am dreaming about is cranking up a macro, launching the DOS
window with the right parameter, pipe the output of the batch file
into the spreadsheet, check to see if the windows open, and if so,
kill it, then loop all over again. Once I gather the data, I put it
into a real application, (i.e., DATABASE).

God help me.
 
T

Tom Ogilvy

The shell command can be used to start your executable (and will open a
window)

http://support.microsoft.com/?id=214248
XL2000: How to Force Macro Code to Wait for Outside Procedure

http://support.microsoft.com/?id=129796
HOWTO: 32-Bit App Can Determine When a Shelled Process Ends

http://support.microsoft.com/?id=147392
XL: How to Force Macro Code to Wait for Outside Procedure

http://support.microsoft.com/default.aspx?scid=kb;en-us;147659
HOWTO: Get a Window Handle Without Specifying an Exact Title
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top