ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   awaiting the execution of code... (https://www.excelbanter.com/excel-programming/398988-awaiting-execution-code.html)

Brad

awaiting the execution of code...
 
I have a Selection.FormulaArray line of code that has to wait on a link to
supply data to compute the array formula and populate the cells it controls.

Well, from those data, I calculate min and max cell values to carry over to
a chart to define the limits on the Y-axis.

My issue is the code executes down and to the point where it wants those min
and max values, but they are not available... yet... so I get an error
message.

I have tried Application.Wait Now + TimeValue ("00:00:15") and other similar
tactics hoping to slow the execution of the code until the
Selection.FormulaArray grabs its data and performs the calculations, but in
every case, whatever method I employ seems to stop the calculation process,
so I gain no advantage by attempting to sort of pause the code execution
until the data are ready for the min and max variables.

What a mess... I am looking for some way to work around this. My thanks
in advance for any suggestions.

B. Reid



JW[_2_]

awaiting the execution of code...
 
Have you tried placing DoEvents before the chart processing?
Brad wrote:
I have a Selection.FormulaArray line of code that has to wait on a link to
supply data to compute the array formula and populate the cells it controls.

Well, from those data, I calculate min and max cell values to carry over to
a chart to define the limits on the Y-axis.

My issue is the code executes down and to the point where it wants those min
and max values, but they are not available... yet... so I get an error
message.

I have tried Application.Wait Now + TimeValue ("00:00:15") and other similar
tactics hoping to slow the execution of the code until the
Selection.FormulaArray grabs its data and performs the calculations, but in
every case, whatever method I employ seems to stop the calculation process,
so I gain no advantage by attempting to sort of pause the code execution
until the data are ready for the min and max variables.

What a mess... I am looking for some way to work around this. My thanks
in advance for any suggestions.

B. Reid




All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com