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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,051
Messages
6,122,872
Members
449,097
Latest member
dbomb1414

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