Excel VBA macros and real time data calculations

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
 
G

Guest

Have you tried adding "DoEvents" to allow things to complete before execution
continues?
 
C

caddy_shack05

I tried both doEvents and BackgroundQuery to false but neither one
worked. Thanks for the suggestions though
 
T

Tom Ogilvy

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top