#1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default 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
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 do I pause a macro? Dave H Excel Discussion (Misc queries) 5 May 3rd 08 04:53 PM
Pause Macro 2 Ollie Excel Discussion (Misc queries) 3 June 15th 06 04:49 AM
Pause? Pete Fedrowitz Excel Programming 2 February 13th 04 06:05 PM
Pause during a Macro Marie[_3_] Excel Programming 6 January 18th 04 12:18 PM
Pause macro Bill Barclift Excel Programming 0 September 30th 03 09:22 PM


All times are GMT +1. The time now is 03:23 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"