ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel volatil functions questions (https://www.excelbanter.com/excel-programming/337419-excel-volatil-functions-questions.html)

nicgendron[_5_]

Excel volatil functions questions
 

Hi,

If, for example, I have a function that is used in a report template
and that needs to do some processing on the date.

processDate(A1) where A1 contains the NOW() excel function.

I have to questions :
- I want the result of processDate() to be automatically recalculate
when the user press F9, is volatil the good way to do?

- When Excel refresh its data, will it refresh the NOW() cell before
the processDate cell because if not, the result of processDate could be
wrong?

Thanks

Nic


--
nicgendron
------------------------------------------------------------------------
nicgendron's Profile: http://www.excelforum.com/member.php...o&userid=25151
View this thread: http://www.excelforum.com/showthread...hreadid=396201


Tushar Mehta

Excel volatil functions questions
 
With very few exceptions, Volatile is *never* the way to go. To me it
is simply a sign of an uninformed or a lazy programmer.

If A1 contains NOW() and somewhere else you have =ProcessDate(A1), XL
will process the cells in the correct sequence. It builds its own
'chains' of what cells need to be processed in what order.

As long as ProcessDate doesn't access elements of XL object model other
than the arguments, there is no need for it to be a volatile function.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...

Hi,

If, for example, I have a function that is used in a report template
and that needs to do some processing on the date.

processDate(A1) where A1 contains the NOW() excel function.

I have to questions :
- I want the result of processDate() to be automatically recalculate
when the user press F9, is volatil the good way to do?

- When Excel refresh its data, will it refresh the NOW() cell before
the processDate cell because if not, the result of processDate could be
wrong?

Thanks

Nic


--
nicgendron
------------------------------------------------------------------------
nicgendron's Profile:
http://www.excelforum.com/member.php...o&userid=25151
View this thread: http://www.excelforum.com/showthread...hreadid=396201



nicgendron[_6_]

Excel volatil functions questions
 

Ok, but what should I do if I'm in the following situation :

I want to make a excel model file to generate report each day.
The report sheet uses my add-in and call the following function
"GetCurrVall"

At implementation level, this function uses a library to access
server and get some value.

In the report sheet, there is a lot of those calls.

My problem is :
When somebody opens the model to generate the report, he should refres
all the cells. If I don't put the volatile attribute in the function
the user has to manually refresh the cells that use "GetCurrVall". B
putting the volatile attribute, he just has to press F9 and that'
done.

My question is :
Is there another way to easyly refresh all the data given by my add-i
?

Ni

--
nicgendro
-----------------------------------------------------------------------
nicgendron's Profile: http://www.excelforum.com/member.php...fo&userid=2515
View this thread: http://www.excelforum.com/showthread.php?threadid=39620



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

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