PDA

View Full Version : [SOLVED] 'Application.Volatile True' question



malik641
08-05-2005, 11:38 AM
When I use the

Application.Volatile True
method for my function, I noticed that the MsgBox's that I have for the function appear in the other workbook(s) when I make a change in a worksheet. Why?

In my function the MsgBox's are in a FOR-NEXT loop, but my loop is as stated:


]For Each cmt In Application.Caller.Parent.Comments
'Code
Next cmt

The MsgBox is within an IF statement and is looped (if that matters :dunno ) to repeat different values for the function I'm debugging.

How can I stop this??

Zack Barresse
08-05-2005, 12:00 PM
I'd read up on the Volatile method in the VBA help files. Basically, that means that any time any change is made in any open workbook, that cell will be calculated, no matter what. Similar (native) functions include TODAY, RAND, NOW, OFFSET*. They will behave the same way.

*The OFFSET function is a volatile function, although not origially designed that way, it is an error (acknowledged by MS) in the coding and will probably be fixed in newer versions of Excel (I would suspect anyway).