Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Application.Ontime help (Excel 2003)

No sure if anyone have the same experience. Basically, I have to use
Application.Ontime to get market data from Bloomberg, and I know
Application.Ontime is the only valid way from what I searched.

Okay, here is the problem :

I have a Bloomberg module using Application.Ontime to control and make
sure I get the market data.

Private Sub StartTimer()
RunWhen_bb = Now + TimeSerial(0, 0, cRunIntervalSeconds_bb)
Application.OnTime earliesttime:=RunWhen_bb,
procedu=cRunWhat_bb, schedule:=True
End Sub

Private Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen_bb, procedu=cRunWhat_bb,
schedule:=False
End Sub

.... and I am calling this module/function from another module. My
problem is that it looks like there is no way to make sure the
Bloomberg module is finished before the "on-going" code runs. As I
shown in the following, I used infinite loop and try to make sure I get
Bloomberg data before I proceed. But what I found was that, the
procedure triggered by Application.Ontime function will NOT run, usless
I EXIT THE LOOP...

Sub A()
Dim done As Integer
done = 0
Do While done = 0
If (iRunCnt_bb = 0) Then
' run bb
Call bb_Main
ElseIf (iRunCnt_bb = maxRun_bb) Then
done = 1
End If
Loop

' Code depend on bb_Main....

End Sub

Appreciate if someone can share some experience.

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
Help with Application.OnTime [email protected] Excel Programming 1 April 3rd 06 06:02 PM
Application OnTime...need some help to schedule. wayliff[_14_] Excel Programming 1 January 19th 06 07:47 PM
application.ontime rick Excel Programming 2 July 25th 05 06:09 PM
Application.OnTIme Mike Excel Programming 8 September 15th 04 03:27 PM
Application.OnTime and Visual C++ cdupain Excel Programming 0 November 12th 03 10:11 AM


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