none
Excel XLL (Excel-DNA) Non-Volitile UDF called during undesired Calculate when Excel opens Workbook saved in previous version. RRS feed

  • Question

  • Hello,

    I have an issue where Excel 2016 is running a Calculate when opening up a Workbook saved in Excel 2013. There are thousands of XLL UDF calls in the Workbook and it takes a very long time to open the file. The workbook cannot be saved in Excel 2016. The UDF is written in a C# XLL Add-in that uses Excel-DNA. It is decorated with [ExcelFunction(IsVolatile = false)].

    I have been looking for a way to prevent this re-calculation without using a registry key modification (FullCalcOnLoadOldFile):

    • "https://www.extracomm.com/Extracomm/FAQ.NSF/0/A745B9D2F63764C448257A3200299DD8
    • "http://www.decisionmodels.com/calcsecrets.htm

    I have been looking at returning the original value of the cell if the Workbook is performing an undesired re-calculation. I saw this post on StackOverflow mentioning that it is it possible to return the original value in an XLL by flagging the function as a macro function.

    • "https://stackoverflow.com/questions/6198140/vba-excel-udf-retaining-original-value?rq=1

    I have not been able to find a reference on how to do this. Would someone know how to identify an XLL UDF as a macro function? Is anyone familiar with a way to only return the existing cell value instead of recalculating the value using the UDF?

    Please Advise,

    Seth

    Monday, November 26, 2018 11:22 PM

All replies