Excel VBA macros and real time data calculations

  • Thread starter Thread starter caddy_shack05
  • Start date Start date
C

caddy_shack05

I have written an excel macro in a spreadsheet that subscribes to real
time market data. The marco loops through a list of symbols. For each
symbol it places the symbol on a summary sheet in cell A1. this sheet
downloads some specific data for that symbol. The code then takes some
specific cells C5 D5 D7 and takes these values and puts them on the
"final" sheet next to the symbol. this creates a sheet for all the
syumbols with all the relavant data needed for rankings. However when
the Macro executes it does not allow Excel to get the real time data.
Instead it runs through the whole macro before alling the outside data.

When it does call the outside data it makes a call for each symbol.
However this is done after the macro completes. I think I am missing
some system call to allow the macro to execute outside calculations
before looping through the next symbol. any help would be greatly
appreciated.


Thanks
 
Have you tried adding "DoEvents" to allow things to complete before execution
continues?
 
I tried both doEvents and BackgroundQuery to false but neither one
worked. Thanks for the suggestions though
 
then perhaps you are not doing it properly. That is the property that
controls what you are complaining about - at least for querytables which it
sounds like you are using.
 
Hi,

I presume you are using DDE to pull in real time data?

You cannot RELIABLY run a macro to pull in real time data and manipulate it
within the same call to VBA.

You need to create two buttons and split the workload (if this is a DDE
question).

I've been working with DDE for far too long - it's a nasty technology. Good
luck.
 
Back
Top