ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pause (https://www.excelbanter.com/excel-programming/300117-pause.html)

cogent

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



Tim Williams

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





cogent

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







Nigel[_8_]

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






All times are GMT +1. The time now is 03:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com