Hi Armando,
You definitely don’t need IsMacroType=true in order to call
XlCall.Excel(XlCall.xlSheetNm, caller)
But I think you do need IsMacroType=true to get the old cell value with
var res = caller.GetValue();
It is a bit of a danger sign that you are using the old value of the cell somehow.
It might mean you’re going a far off the normal path, especially mixing that in with RTD-based functions.
Otherwise your understanding is right - there are two recalculation issues:
-Govert
From: exce...@googlegroups.com <exce...@googlegroups.com> On Behalf Of armandos...@gmail.com
Sent: 14 November 2022 17:38
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Re: Formulas always execute when the workbook opens, when using refereces
Hi Govert, thanks a lot for your response,
The reason why we use IsMacroType option, I think is because during the execution of the formulas we need to recover information about the workbook. We invoke functions like this one:
XlCall.Excel(XlCall.xlSheetNm, caller)
and also this one:
var caller = (ExcelReference)XlCall.Excel(XlCall.xlfCaller);
About the RTD functions, your are right, even if I remove the IsMacroType option, the formulas still execute when I open the workbook. So, as far as I understand, the only options we have to avoid this behavior are:
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/691d6c0e-3ff2-48d7-8bcd-da2d7f7dfa99n%40googlegroups.com.