【问题标题】:EPPlus issue with R1C1-reference to absolute column in formulaEPPlus 问题 R1C1 引用公式中的绝对列
【发布时间】:2017-10-05 12:54:18
【问题描述】:

我最近从 interop/closedxml 切换到 EPPlus,我注意到 EPPlus 处理 R1C1 绝对引用的方式不同。

考虑下面的代码

int colIndex = 5;
string formula = string.Format("MATCH(@""12345"",C{0},0)", colIndex);

int targetCellRow = 1;
int targetCellColumnAbs = 1;
workSheet.Cells[targetCellRow, targetCellColumnAbs].FormulaR1C1 = formula;

使用 EPPlus 这将导致:

=MATCH("12345";Inkoopdelen!R[4]C[2];0)

使用 InterOp 和 ClosedXML

=MATCH("12345";Inkoopdelen!C5;0)

在我的最终结果中,EPPlus 公式不起作用,因为它引用了一个单元格而不是列范围。它还引用了错误的列。

单元格 A1 中的引用 R[4]C[2] = A 列右侧的两列 = C 列。

对第 5 列的绝对引用应导致 E 列(C[4] 或 C5)。

如何使用 EPPlus 来尊重我在公式中输入的绝对范围引用?

【问题讨论】:

    标签: c# excel epplus epplus-4


    【解决方案1】:

    原来这是 EPPlus 的一个缺点,我更改了 EPPlus 源来解决这个问题: https://github.com/JanKallman/EPPlus/pull/22

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-15
      • 1970-01-01
      • 1970-01-01
      • 2016-11-09
      相关资源
      最近更新 更多