LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Refreshing Query Tables

Suspect this is in a sheet module in which case, the unqualified references
will remain pointed at the sheet containing the module rather than the
activesheet (which is your intent). The revision below should work if my
assumption is correct.

For Each ws In Worksheets
' ws.Activate
For Each ws.query In QueryTables
ws.query.Refresh BackgroundQuery:=False
Next
Next


--
Regards,
Tom Ogilvy

"Simon Shaw" wrote in message
...
I am trying to run a macro to refresh all query tables in my sheet. I am
using the following code, but it does not seem to update the tables, but

it
doesn't error out either. any ideas?

For Each ws In Worksheets
ws.Activate
For Each query In QueryTables
query.Refresh BackgroundQuery:=False
Next
Next



 
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
Refreshing an Excel Query DWIGHTBALLMORRILL Excel Discussion (Misc queries) 1 March 4th 08 06:38 PM
Refreshing Pivot Tables hnyb1 Excel Discussion (Misc queries) 1 September 13th 07 01:21 PM
Refreshing Pivot Tables Lisa Excel Worksheet Functions 2 May 17th 07 04:19 PM
Refreshing Query Tables FSt1 Excel Programming 0 August 26th 04 03:16 PM
Refreshing Pivot Tables QUery Ron McCormick[_2_] Excel Programming 1 December 3rd 03 06:31 PM


All times are GMT +1. The time now is 02:57 PM.

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

About Us

"It's about Microsoft Excel"