Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro which automates my whole spread sheet which consists of
Database references and SQL statements. I have included the macro to update the SQL statements before I save the sheet using the current date as a filename. But I find that because there is a lag for the SQL request the file is saved without the current SQL data. But as soon as I (F9) recalculate the sheet after the macro has completed it shows the current data!? I am specifying in the macro to CALCULATE before it saves but this does not help. Is there any way to suspend the macro as it runs the SQL update all command? Even if it is a preset time since the maximum time to wait for the Request would never be greater than 15s. Thanks again to all those generous people sharing their experience with us who are in need. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are using querytables, then you need to do foreground queries and the
macro will wait for them to complete Dim qt as QueryTable for each qt in ActiveSheet.querytables qt.Refresh BackgroundQuery:=False Next -- Regards, Tom Ogilvy Rudolphs wrote in message ... I have a macro which automates my whole spread sheet which consists of Database references and SQL statements. I have included the macro to update the SQL statements before I save the sheet using the current date as a filename. But I find that because there is a lag for the SQL request the file is saved without the current SQL data. But as soon as I (F9) recalculate the sheet after the macro has completed it shows the current data!? I am specifying in the macro to CALCULATE before it saves but this does not help. Is there any way to suspend the macro as it runs the SQL update all command? Even if it is a preset time since the maximum time to wait for the Request would never be greater than 15s. Thanks again to all those generous people sharing their experience with us who are in need. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I write a request to 'Save As' Macro | Excel Discussion (Misc queries) | |||
Macro Request: Fill in empty cells with previous Filled cell in column | Excel Worksheet Functions | |||
How to Create an Excel Macro to send a meeting request. | Excel Discussion (Misc queries) | |||
Password request to run macro | Excel Programming | |||
Request password during Protect macro | Excel Programming |