Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Make onTimer wait until Excel finish database request?
Hi all,
I have a spreadsheet that: 1) Every minute connect to a database importing data to Excel (no vba) 2) Every half hour save the spreadsheet to disk (vba onTimer event) Sometimes the two "timers" collide bringing up a popup, asking if the user will save now, or wait for the update. It stops everything. Is there a way to avoid the popup? - It does not matter if the current database update or save is canceled. -- Hans |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Make onTimer wait until Excel finish database request?
In the OnTimer event, check first if the database query is refreshing or not
before saving the workbook. Assuming the database query is in Sheet1, and that there is only one query, then in the onTimer event in VBA If Not Sheet1.QueryTables(1).Refreshing then thisworkbook.save End If Another way is to disable the automatic refresh of the database query and let your VBA code do the refresh. In this way, you have full control of both events. "news.stofanet.dk" wrote: Hi all, I have a spreadsheet that: 1) Every minute connect to a database importing data to Excel (no vba) 2) Every half hour save the spreadsheet to disk (vba onTimer event) Sometimes the two "timers" collide bringing up a popup, asking if the user will save now, or wait for the update. It stops everything. Is there a way to avoid the popup? - It does not matter if the current database update or save is canceled. -- Hans |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Make onTimer wait until Excel finish database request?
thanks a lot, I'll give it a try.
-- Hans "Vergel Adriano" wrote in message ... In the OnTimer event, check first if the database query is refreshing or not before saving the workbook. Assuming the database query is in Sheet1, and that there is only one query, then in the onTimer event in VBA If Not Sheet1.QueryTables(1).Refreshing then thisworkbook.save End If Another way is to disable the automatic refresh of the database query and let your VBA code do the refresh. In this way, you have full control of both events. "news.stofanet.dk" wrote: Hi all, I have a spreadsheet that: 1) Every minute connect to a database importing data to Excel (no vba) 2) Every half hour save the spreadsheet to disk (vba onTimer event) Sometimes the two "timers" collide bringing up a popup, asking if the user will save now, or wait for the update. It stops everything. Is there a way to avoid the popup? - It does not matter if the current database update or save is canceled. -- Hans |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to make reference to database and if true copy from database? | Excel Discussion (Misc queries) | |||
OnTimer Event | Excel Programming | |||
Make an Access Database out of Excel spreadsheet | New Users to Excel | |||
SQL.Request from Oracle Database | Excel Programming | |||
sql.request for secured Access Database record retrieval | Excel Programming |