View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dmthornton dmthornton is offline
external usenet poster
 
Posts: 19
Default Writing streaming data to txt file

I'm curious... how are you streaming the data into Excel? Is the external
source streaming text data into the clipboard and then you paste it into
Excel?

You can use Application.OnTime to have Excel run a routine at a set time.
I've tested this out before with this code that might be useful. This routine
just writes a timestamp to a sheet and then schedules itself again to run 1
minute later:

Sub TestSchedule()
Range("a65536").End(xlUp).Offset(1, 0) = Now()
'set schedule to run in 1 minute
Application.OnTime TimeValue(DateAdd("n", 1, Now)), "TestSchedule"
End Sub


" wrote:

I have data streaming in to excel from an external source. I would
like to capture this data every given interval (say 5 seconds) and
write it to a text file.
I know how to open a text file and write static data, however, I do not
know how to handle streaming data.