Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel/MSQuery - Detect when Refresh has occured

Hi Everyone,

I've got an ODBC Query which is set to automatically refresh if the
selection criteria cell (to which it is linked) changes.

Is there a way to programatically detect that the refresh has occured?
I need to update another cell after any refresh.

Perhaps I need only to detect if the selection criteria cell contents
has changed.

If anyone can suggest either solution, that would be great.

Regards


Greg Glynn

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel/MSQuery - Detect when Refresh has occured

It's OK .. I figured it out.

1) Switch off automatic refresh in the Query
2) Detect a change in the Criteria Cell and then force a Refresh to
the query table.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Target.AddressLocal = "$F$11" Then
ActiveSheet.Range("C103").QueryTable.Refresh
End If
End Sub

3) Do whatever

Thanks anyway People.

Greg Glynn wrote:

Hi Everyone,

I've got an ODBC Query which is set to automatically refresh if the
selection criteria cell (to which it is linked) changes.

Is there a way to programatically detect that the refresh has occured?
I need to update another cell after any refresh.

Perhaps I need only to detect if the selection criteria cell contents
has changed.

If anyone can suggest either solution, that would be great.

Regards


Greg Glynn


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 2000: An Error Occured Initializing the VBA Libraries (2) [email protected] Excel Discussion (Misc queries) 1 August 30th 06 01:18 PM
Refresh MSQuery w/ Access datasource issue Chris B Excel Discussion (Misc queries) 1 June 29th 06 08:46 PM
Unexpected error occured. - MS Excel Erlington Excel Discussion (Misc queries) 0 June 25th 06 04:30 PM
MsQuery Refresh Message CurtH Excel Programming 1 January 19th 06 12:59 PM
Wait until MSQuery Refresh finished ChrisR[_2_] Excel Programming 1 September 19th 05 05:59 PM


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