VBa, VBS & .Bat ... Yum!

slinky

Active Member
Joined
Dec 19, 2008
Messages
294
Yeah, that's a lovely combination, right?

I already have a solution for this, but it's somewhat clunky at best.

The scenario:

I have an application which will "print" data into an active Excel sheet. The output of this application can be automated using a batch file to call a number of files (parameters definitions) to generate a "printed" report in Excel.

I can call this batch file from within Excel, having already selected the intended print destination.

That bit is simple.

The complexity:

An external application is delivering data into Excel, I can't control when Excel does carries out any further actions, as the "print" of data can take a variable amount of time to deliver it's work

The Requirement:

Tightly control a chain of external reports.
At present, and against my real desire, I've written a mechanism whereby VBa calls the batch file, the batch file calls the external app, then, after the app is finished, calls VBS to call another VBa routine to run the next batch file.

Still with me?
I think you'll agree that it's quite horrible.

I've tried getting Excel to pause, waiting for the batch file to finish, but doing that stops the app from being able to print into Excel. As previously mentioned, I can't use a timer as the run time is variable.

The Question:

Can you think of a better way of doing this? Or shall I just persist with the nasty, multi-language, cludgy solution?
Cheers...
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top