I ran into the same problem in XE2, and my solution was to replace code samples like this:
fExcel.ActiveWorkBook.ActiveSheet.Range[ fExcel.ActiveWorkBook.ActiveSheet.Cells[3, 2], fExcel.ActiveWorkBook.ActiveSheet.Cells[3+i,1+XL_PT_Tip_FieldCount] ].Formula := VarArr;
from:
cl := fExcel.ActiveWorkBook.ActiveSheet.Cells[3, 2]; ch := fExcel.ActiveWorkBook.ActiveSheet.Cells[3+i,1+XL_PT_Tip_FieldCount]; fExcel.ActiveWorkBook.ActiveSheet.Range[cl, ch].Formula := VarArr;
The same thing happens in this case when a sheet variable is used:
sheetDynamicHb := fExcel.ActiveWorkBook.Sheets['Dynamics Hb']; cl := sheetDynamicHb.Cells[52, 2]; ch := sheetDynamicHb.Cells[52+i, 2+3]; sheetDynamicHb.Range[cl, ch].Formula := VarArr;
Somehow introducing temporary variables ( cl,ch: Variant ) does the trick. It seems that accessing a nested Excel variable does something strange. I canβt explain why this works this way, but it works.
Kromster
source share