Excel from Batch File Problem

P

PcolaITGuy

Having problems getting Excel to hand control back to the batch file that
kicks it off.

I have a Win2000 Scheduled Task that executes a batch file. The batch file
kicks off an Excel Spreadsheet followed by running an Access macro from the
batch file. The spreadsheet uses web queries to build a small table and. A
macro assigned to the This Workbook Open module has a "Me.RefreshAll" line
followed by a "Me.Close savechanges:=True". Once the data refreshes, the
workbook closes and saves the changes.

Here is what my batch file looks like:

"C:\Office\excel.exe" "c:\scripts\usercount.xls"
echo Excel Procedure Complete
"C:\Office\msaccess.exe" "c:\scripts\usertraffic.mdb" /Excl /X getinfo

The spreadsheet does perform all actions that it is supposed to by running
the data refresh then closing the workbook saving changes...only problem is
that Excel is still running and the batch file does not continue to the
second line. There are no errors being reported.

What's going on?
 
J

Jim Thomlinson

It is a little bit cludgy but how about using 2 batch files run with a time
initerval inbetween. The first batch file executes the Excel and then a few
minutes later (depending on how long you anticipate the XL file to take)
execute the Access macro from a different batch file...
 

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