Excel volatil functions questions

  • Thread starter Thread starter nicgendron
  • Start date Start date
N

nicgendron

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top