Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default wait before executing rest of a macro

how can you have a macro wait until a external connections have been updated
before contunueing?

practically, the macro has to wait until the following code has been
finished before continueing.

ActiveWorkbook.RefreshAll

Tried Application.Wait (Now + TimeValue("0:00:15")) but this stops
everything, even the refresh.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default wait before executing rest of a macro

hi, Luc !

how can you have a macro wait until a external connections have been updated before contunueing?
practically, the macro has to wait until the following code has been finished before continueing.

ActiveWorkbook.RefreshAll

Tried Application.Wait (Now + TimeValue("0:00:15")) but this stops everything, even the refresh.


if 15 seconds are enought wait-time for the rest of your procedure... try using two macros (i.e.)

Sub Macro1()
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue("0:00:15"), "macro2"
End Sub

Sub Macro2()
' here the rest of your procedure... '
End Sub

hth,
hector.


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
Wait statement in macro tjfwestcoast Excel Discussion (Misc queries) 1 February 5th 10 08:35 PM
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Macro Wait command Donkin[_3_] Excel Programming 2 June 2nd 05 10:45 PM
Macro Wait command fastmonkey512 Excel Programming 0 June 2nd 05 04:12 PM
finding the first blank cell and then executing rest of macro Ed[_25_] Excel Programming 1 December 13th 04 07:24 PM


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

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

About Us

"It's about Microsoft Excel"