1
Vote

Formula which includes cell ref like "A:B" cannot copy correctly.

description

// with
cell1.Formula == "VLOOKUP(C1, A:B, 2)"
// do
cell1.Copy(cell2)
// then
cell2.Formula == "VLOOKUP(C2, #REF!, 2)"
It is probrem of ExcelCellBase::UpdateFormulaReferences() or ExcelAddressBase called by ExcelRangeBase::Copy.

I think that ExcelAddressBase recognizes "A:B" as "A1:B1048576", so, cell1.Copy(cell2) makes "A2:B1048577" and B1048577 causes "#REF!".

I think that it is good to correct ExcelAddressBase so that "A: B" is recognized as "A$1:B$1048576", but I do not have confidence to correct it properly.

comments