View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Auto Open macro not performing as expected

I don't speak queries, but can't you set the .BackgroundQuery = False and have
excel wait for it to be refreshed?



JonR wrote:

Hi

I hav e aspreadsheet that I would like to update every time it is opened. It runs multiple queries to an external database, which fill in the current data. Afterward, I have one cell which the update MS Query function deletes the content and I have to type the name ("unassigned") manually to keep the graphs from having a blank in the legend. Unfortunately, the word "Unassigned" is placed into the appropriate cell before the data is updated, and is subsequently erased during the update process. Is there a way I can adjust the timing of these events, or add a second subroutine to perform the correct actions in sequence? Code below.
TIA

Sub Auto_Open()
'
' Refresh Macro
' Macro recorded 7/21/2004 by JonR
'

'
ActiveWorkbook.RefreshAll
Sheets("SR List Detail DATA & CHARTS").Select
Range("E5").Select
ActiveCell.FormulaR1C1 = "Unassigned"

End Sub


--

Dave Peterson