Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Background refresh not working

I attempt to referesh column using the query and it is not happening
as long as macro is running so I can not combine this macro with
following one, what do I do wrong?

Sub UpdateSafety()
'
' UpdateSafety Macro
' Macro recorded 5/4/2007 by dispatch
'
Sheets("Review").Select
Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=True

Application.Wait Now + TimeSerial(0, 0, 10)

Sheets("ISC METS").Select
Range("A6").Select

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Background refresh not working

I don't understand your logic of attempting a background refresh
(asynchronous) then waiting in code for 10 seconds anyway. Why not just do a
synchronous refresh, so the code waits until the refresh is complete ?

Anyway, it may depend on the type of query that underlies the QT:

<From Help for the Refresh Method
BackgroundQuery Optional Variant. Used only with query tables based on the
results of an SQL query. True to return control to the procedure as soon as
a database connection is made and the the query is submitted (the query is
updated in the background). False to return control to the procedure only
after all data has been fetched to the worksheet. If this argument isn't
specified, the setting of the BackgroundQuery property determines the query
mode.
</From Help for the Refresh Method

NickHK

"GorKo" wrote in message
oups.com...
I attempt to referesh column using the query and it is not happening
as long as macro is running so I can not combine this macro with
following one, what do I do wrong?

Sub UpdateSafety()
'
' UpdateSafety Macro
' Macro recorded 5/4/2007 by dispatch
'
Sheets("Review").Select
Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=True

Application.Wait Now + TimeSerial(0, 0, 10)

Sheets("ISC METS").Select
Range("A6").Select

End Sub



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
Pivot Table Refresh not working properly Satish Excel Discussion (Misc queries) 1 February 8th 10 01:00 PM
Auto Refresh of Pivot Tables not working meo Excel Worksheet Functions 0 March 13th 08 05:31 PM
refresh option of pivot table not working ceejgrl Excel Worksheet Functions 1 October 30th 06 11:28 PM
External Data Refresh not working Mike B in VT Excel Discussion (Misc queries) 0 February 10th 06 06:23 PM
Macro working in background ie not on activesheet Dynamiteskippy Excel Programming 1 May 28th 05 03:53 AM


All times are GMT +1. The time now is 03:43 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"