Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB refresh of query
Okay here is the code used to open a workbook, refresh the query, save the
work book and exit out of it. Problem is that the save script acts prior to the refresh of the query completing and get an error "This action will cancel a pending Refresh Data Command." How do I allow all queries to refresh prior to saving and closing the workbook? Sub Refresh() ' ' Refresh Macro ' Macro recorded 5/3/2007 by Authorized User ' ' Keyboard Shortcut: Ctrl+Shift+R ' ChDir "File Location" Workbooks.Open Filename:= _ "File name" ActiveWorkbook.RefreshAll ActiveWindow.ScrollWorkbookTabs Position:=xlFirst Sheets("Control").Select ActiveWorkbook.Save ActiveWindow.Close End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I 'Enable Automatic Refresh' for Query Refresh by default | Setting up and Configuration of Excel | |||
Query Refresh-Enable Automatic Refresh Dialogue Box | Excel Discussion (Misc queries) | |||
Timing of automatic query refresh and macro pivot table refresh | Excel Programming | |||
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) | Excel Programming | |||
Web Query fail to Refresh All but individual refresh is ok | Excel Programming |