ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tell in UDF if Calced Manually (https://www.excelbanter.com/excel-programming/367865-tell-udf-if-calced-manually.html)

Matthew Wieder[_3_]

Tell in UDF if Calced Manually
 
What property can I use in a UDF to determine wether the calculation
currently exectuing is as a result of an F9 push vs. the result of the
workbook being opened and 'auto calc on open' is set? I know about
determining wether excel is set to auto calc vs. manual calc in general,
but this case is where it is set to manual calc with the exception of
the 'auto calc on open' setting and I need to tell the difference
between the two.
thanks.

Chip Pearson

Tell in UDF if Calced Manually
 
There is no way to determine this. Why should the code care?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Matthew Wieder" wrote
in message ...
What property can I use in a UDF to determine wether the
calculation currently exectuing is as a result of an F9 push
vs. the result of the workbook being opened and 'auto calc on
open' is set? I know about determining wether excel is set to
auto calc vs. manual calc in general, but this case is where it
is set to manual calc with the exception of the 'auto calc on
open' setting and I need to tell the difference between the
two.
thanks.




Matthew Wieder[_3_]

Tell in UDF if Calced Manually
 
We have a UDF that writes data back to an external database. We want to
avoid the case where someone who opens a workbook with our UDF and has
'auto calc on open' set would write to the database the old value that
was stored in their workbook, thereby overwriting any changes made to
that value by someone else directly in the database. If the user has
specifically calced the function then we know he wants to write it back,
we're trying to avoid the accidental writeback that automatically occurs.

Chip Pearson wrote:

There is no way to determine this. Why should the code care?




All times are GMT +1. The time now is 09:51 AM.

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