Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make reference to database and if true copy from database? V!p3r Excel Discussion (Misc queries) 4 February 5th 07 02:19 PM
OnTimer Event Brad Excel Programming 3 April 25th 05 04:33 PM
Make an Access Database out of Excel spreadsheet ahmebah New Users to Excel 0 February 11th 05 02:45 PM
SQL.Request from Oracle Database CraigRhino Excel Programming 1 February 25th 04 10:33 PM
sql.request for secured Access Database record retrieval Theo Fountain Excel Programming 0 July 17th 03 08:14 PM


All times are GMT +1. The time now is 06:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"