Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pause
Try
Application.OnTime() Tim "cogent" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pause
Yup, that worked... Thank you.
"Tim Williams" <saxifrax at pacbell dot net wrote in message ... Try Application.OnTime() Tim "cogent" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pause
Hi,
If , as you say, there is another loop that waits in increments of 15 seconds until the data is collected, It must be assumed you know when this occurs - so why not use this to trigger the next procedure? Cheers Nigel "cogent" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I pause a macro? | Excel Discussion (Misc queries) | |||
Pause Macro 2 | Excel Discussion (Misc queries) | |||
Pause? | Excel Programming | |||
Pause during a Macro | Excel Programming | |||
Pause macro | Excel Programming |