![]() |
Excel VBA macros and real time data calculations
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 |
Excel VBA macros and real time data calculations
Have you tried adding "DoEvents" to allow things to complete before execution
continues? -- HTH... Jim Thomlinson " wrote: 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 |
Excel VBA macros and real time data calculations
Set the Backgroundquery property to False
-- Regards, Tom Ogilvy wrote in message oups.com... 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 |
Excel VBA macros and real time data calculations
I tried both doEvents and BackgroundQuery to false but neither one
worked. Thanks for the suggestions though |
Excel VBA macros and real time data calculations
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. -- Regards, Tom Ogilvy wrote in message oups.com... I tried both doEvents and BackgroundQuery to false but neither one worked. Thanks for the suggestions though |
Excel VBA macros and real time data calculations
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. -- www.alignment-systems.com " wrote: 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 |
All times are GMT +1. The time now is 05:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com