Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Excel from Batch File Problem

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Excel from Batch File Problem

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...
--
HTH...

Jim Thomlinson


"PcolaITGuy" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Excel from Batch File Problem

you might need something like:

Application.Quit

after saving the workbook
--
Gary''s Student - gsnu200764


"PcolaITGuy" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to Run a Batch File?!? carla New Users to Excel 3 January 20th 07 02:32 AM
Batch file initiation from Excel macro? Yarroll Excel Discussion (Misc queries) 1 October 13th 06 02:50 PM
Call a batch file from an Excel Macro Alex Horan Excel Discussion (Misc queries) 0 March 2nd 06 03:29 PM
Call a batch file from an Excel Macro Gary''s Student Excel Discussion (Misc queries) 0 March 2nd 06 03:26 PM
How can I batch open a txt file in excel 2003 and save back as a . P Silzle Excel Discussion (Misc queries) 3 February 9th 05 11:44 PM


All times are GMT +1. The time now is 04:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"