'Prevent Excel custom function running on file open

I am building an Excel add-in with many custom functions. They work fine, however, when I close and reopen the file, all functions are recalculated. Since each custom function makes an API request to my website and the data does not change frequently, I am looking for a way to turn this feature off so that functions do no rerun on file open. I have looked through all the docs but could not find any answers. Really appreciate if someone could help me with this.

My add-in will be used by other users so I am looking for a solution that does not require any extra action from the (like setting the calculation mode of the spreadsheet to manual)



Solution 1:[1]

You can set up the manual calculation in the following way:

Application.Calculation = xlCalculationManual 
Application.CalculateBeforeSave = False

The XlCalculation enumeration specifies the calculation mode.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eugene Astafiev