View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Niek Otten Niek Otten is offline
external usenet poster
 
Posts: 3,440
Default Turning Calcuation Off Completely

please check your system date
--
Kind Regards,

Niek Otten

Microsoft MVP - Excel
"Robin Hammond" wrote in message
...
Here's the problem...

Main routine does this

1. sets calculation to manual, saving old calc state (usually auto)
2. Loops through a region inserting a User Defined Function either cell by
cell as a formula or range by range as an array formula
3. Even though calculation is set to manual, on each insert the UDF

triggers
and calculates even though I don't want it to.
4. The UDF is hitting a web server to return a value from a database and

is
not the quickest thing in the world. It's pretty cool though.
5. Routine completes (slowly because of all the calculations as it goes)
6. Calculation is reset to its old state, and if this was automatic, the

udf
then recalculates all the values even though the udf is not flagged as
volatile and nothing else has changed. If it was manual, I could of course
recalculate at this stage if I needed to.

One problem is that the UDF is in a different addin so I cannot run a

public
variable and use this as a get out clause when the UDF triggers.

Any ideas anybody on how I can really turn calculation off or restructure
this to avoid a double calculation loop.

Thanks as always,

Robin Hammond
www.enhanceddatasystems.com