Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA with real time data

Hi,

I am an amateur VBA programmer and need some help with real time data .
I am using the reuters tool to get the real time data. I intend to
capture this real time data in Excel every ten seconds for all the
stocks that i want to monitor and store it in an array(probably in a
different sheet) of size ten. This would mean that after 100 seconds
when all the cells of all the arrays are filled up the first cell in
each array should be cleared and assigned the current stock value.
This way each cell in the array should get a new value every 100
seconds.

Problem:- I have tried using Application.Ontime and Application .Wait
in a loop to capture these values every ten seconds. But when used in a
loop , the worksheet freezes meaning it stops recieving real time data.
And each cell of any particular array is filled with the same value as
the first cell. I need to somehow figure out how to introduce a delay
in the Sub without freezing the real time data feed . Here is a simple
code i'm trying to use. Please help me with this. I'll greatly
appreciate it.
---------------------------------------------------------------------------------------------------------------------------------------
Sub calling()
Dim i

For i = 1 To 10
Call dataCopy(i)
Call delay
Next

End Sub


--------------------------------------------------------------------------------------------------------------------------------------
Sub dataCopy(rec)
Dim i, j

j = rec

For i = 1 To 6
Worksheets("Sheet2").Cells(i, j).Value = Worksheets("Sheet1").Cells(i,
4)
Next

Exit Sub

End Sub
---------------------------------------------------------------------------------------------------------------------------------------
Sub delay()

Dim newHour, newMinute, newSecond, waitTime
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

End Sub
---------------------------------------------------------------------------------------------------------------------------------------

Regards,
Paresh

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA with real time data

Hi , its me again. I ma new to this group but I can somehow tell that
Tom is best one to help me with this. So, if you can please do reply
hopefully with a solution. If possible email it.Thank you.

Paresh

wrote:
Hi,

I am an amateur VBA programmer and need some help with real time data .
I am using the reuters tool to get the real time data. I intend to
capture this real time data in Excel every ten seconds for all the
stocks that i want to monitor and store it in an array(probably in a
different sheet) of size ten. This would mean that after 100 seconds
when all the cells of all the arrays are filled up the first cell in
each array should be cleared and assigned the current stock value.
This way each cell in the array should get a new value every 100
seconds.

Problem:- I have tried using Application.Ontime and Application .Wait
in a loop to capture these values every ten seconds. But when used in a
loop , the worksheet freezes meaning it stops recieving real time data.
And each cell of any particular array is filled with the same value as
the first cell. I need to somehow figure out how to introduce a delay
in the Sub without freezing the real time data feed . Here is a simple
code i'm trying to use. Please help me with this. I'll greatly
appreciate it.
---------------------------------------------------------------------------------------------------------------------------------------
Sub calling()
Dim i

For i = 1 To 10
Call dataCopy(i)
Call delay
Next

End Sub


--------------------------------------------------------------------------------------------------------------------------------------
Sub dataCopy(rec)
Dim i, j

j = rec

For i = 1 To 6
Worksheets("Sheet2").Cells(i, j).Value = Worksheets("Sheet1").Cells(i,
4)
Next

Exit Sub

End Sub
---------------------------------------------------------------------------------------------------------------------------------------
Sub delay()

Dim newHour, newMinute, newSecond, waitTime
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

End Sub
---------------------------------------------------------------------------------------------------------------------------------------

Regards,
Paresh


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
Capturing Real Time Data Rob Excel Worksheet Functions 2 February 24th 10 04:44 AM
creating dataseries from real time data Maurice Excel Worksheet Functions 0 April 10th 07 02:54 PM
storing real time data Meng Excel Discussion (Misc queries) 1 September 15th 06 04:58 AM
How to add real time data from broker website? Richiverse Excel Programming 1 February 21st 06 04:51 AM


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