0

我有以下示例:

workbook  *wb = 0;
worksheet *ws = 0;
cell_t *c1, *c2 = 0;

wb = xlsNewWorkbook();
ws = xlsWorkbookSheet(wb, "test");

c1 = xlsWorksheetNumberDbl(ws, 2, 1, 12345.512, NULL);
xlsWorksheetNumberDbl(ws, 3, 1, 223.011, NULL);
c2 = xlsWorksheetNumberDbl(ws, 4, 1, 34678.010, NULL);

formula_t *formula = xlsWorksheetFormula(ws);
xlsFormulaPushCellAreaReference(formula, c1, c2, CELL_RELATIVE_A1);
xlsFormulaPushFunction(formula, FUNC_SUM);
xlsWorksheetFormulaCell(ws, 5, 1, formula, NULL);

xlsWorkbookDump(wb, "test.xls");
xlsDeleteWorkbook(wb);

但似乎该公式无法正常工作。

在结果单元格上显示#VALUE!在公式栏上我得到 =B3:B5 而不是 =SUM(B3:B5)。

你能帮我解决这个问题吗?

谢谢

4

0 回答 0