View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Which runs first, Workbook_Open() or external query refresh?

I did a quick test with a MsgBox in the Worksheet_Open event; this message
came up before the message "This book contains automatic queries..." so it
seems that Worksheet_Open comes before any queries refresh.
--
- K Dales


" wrote:

I want to process some data when the user opens a spreadsheet, but not
until an external Access query has been refreshed.

"Refresh data on file open..." has been checked in the data range
properties. But I think my Workbook_Open() code is running before auto
refresh happens.

Where is the best place to put code to ensure that it runs after the
external MS-Query has been updated?

As a last resort, I could have the user press a button after all data
has been refreshed, but that is messy.

Thanks in advance....
...df