Search notes:

Excel Object Model: Application.volatile

application.volatile can be used to mark a user defined function as a volatile function, which affects when this function is called for formula recalculation purposes.
In order to have any effect, this statement must be placed within a user defined function that is used for cell calculation.

Example VBA module

The following VBA module defines a volatile, a non-volatile function and a function (main) that sets up a worksheet in order to be able to experiment with the volatility of VBA functions:
option explicit

global nofVolatileCalls    as long
global nofNonVolatileCalls as long

function volatileFunction() as long ' {

    application.volatile

    nofVolatileCalls = nofVolatileCalls + 1
    volatileFunction = nofVolatileCalls

end function ' }

function nonVolatileFunction() as long ' {

    nofNonVolatileCalls = nofNonVolatileCalls + 1
    nonVolatileFunction = nofNonVolatileCalls

end function ' }

sub main() ' {

  ' Create worksheet with these functions

    dim ws as worksheet
    set ws = activeSheet

    ws.usedRange.clearContents
    ws.usedRange.clearFormats

    ws.cells(2,2) = "Volatile function:"
    ws.cells(3,2) = "Non-Volatile function:"

    ws.cells(2,3).formula = "= volatileFunction()"
    ws.cells(3,3).formula = "= NonvolatileFunction()"

    ws.usedRange.columns.autoFit

end sub ' }
Github repository about-MS-Office-Object-Model, path: /Excel/Application/volatile.vb

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1758209677, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/Office/Excel/Object-Model/Application/volatile(83): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78