Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default open excel 2007 refresh query from batch file

Hello all,

I have a simple script saved as "C:\refresh_excel.vbs" that opens an
Excel file, and does a refresh for a query on Sheet 1. I created a
scheduled task to run this every day.


It worked fine for previous versions of Excel, but since I have
upgraded to Excel 2007 it doesn't work. Any help it helping me figure
this out would be appreciated.


/*contents of refresh_excel.vbs*/
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkBook = objExcel.Workbooks.Open("C:\reports\UPS.xls")
objWorkbook.Sheets("Sheet1").QueryTables(1).Refres h
Wscript.Sleep 6000
objWorkbook.save
objWorkbook.close
objExcel.Quit
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 2007 vba - Refresh after web query? Rui Brito Excel Programming 1 February 27th 08 03:35 AM
Auto Open file VBA Refresh MS Query Save Close gcutter[_2_] Excel Programming 2 September 26th 05 03:07 PM
How to refresh a Excel workbook with pivot & ADO query report in batch mode Karen Middleton Excel Discussion (Misc queries) 1 April 29th 05 02:05 PM
How to refresh a Excel workbook with pivot & ADO query report in batch mode Karen Middleton Excel Programming 1 April 29th 05 02:05 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 02:29 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"