PC Review


Reply
Thread Tools Rate Thread

Background refresh not working

 
 
GorKo
Guest
Posts: n/a
 
      25th Jul 2007
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 With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      25th Jul 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refresh Query Table causing debug error with Background Refresh pr Gum Microsoft Excel Programming 2 12th Mar 2009 10:08 PM
Background SDF Refresh Harry Simpson Microsoft Dot NET Compact Framework 0 26th Nov 2007 04:33 PM
How to refresh window in background Giorgos Microsoft Dot NET Compact Framework 0 19th Apr 2006 11:23 AM
cant refresh background picture Eva Microsoft Powerpoint 4 13th Oct 2004 02:23 AM
Background refresh of GP Jeff Microsoft Windows 2000 Group Policy 9 1st Oct 2004 02:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:56 AM.