Thread: Pause
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cogent cogent is offline
external usenet poster
 
Posts: 32
Default Pause

Hello

My spreadsheet opens by Windows scheduler. It collects several pieces of
information from a commercial information database (through dde links). I
want a macro to send the information out once the data are collected.

I would like the macro to automaticelly initiate upon opening the file. But
it cannot operate immediately inasmuch as the spreadsheet collects
information (dde) for about 30 seconds.

I have tried the following:

Sub RefreshData()

waitTime = TimeSerial(0, 0, 59)
Application.Wait waitTime

RefreshData

End Sub

So that the RefreshData routine will wait 59 seconds until all of the data
is collected (and I have a loop (not shown) which will continue to wait in
increments of 15 seconds until all data is collected.

The only problem is that the above Application.Wait command seems to freeze
EVERYTHING so that it data collection does not happen.

Is there a better way to do this?

Thank you.

W