信息:下面的代码在foreach循环中
Works:
indexSheet.Cell("G" + cellIndex).FormulaA1 = "=SUM(A1:A10)";只起作用,当我直接在excel:中输入它时
indexSheet.Cell("G" + cellIndex).FormulaA1 = "=FIND(\"erw\";H5)"; // with Property
indexSheet.Cell("G" + cellIndex).SetFormulaA1("=FIND(\"erw\";H5)"); //with Function
indexSheet.Cell("G" + cellIndex).FormulaA1 = $"COUNTIF(H{cellIndex};\"*\"&$C$2&\"*\")*(MAX($G$4:G{cellIndex - 1})+1)";
indexSheet.Cell("B" + cellIndex).FormulaA1 = $"=IF(ROW()-{cellIndex}>MAX(G:G);\"\";HYPERLINK(CONCATENATE(\"#\";(INDEX(H:H;MATCH(ROW()-4;G:G;0)));\"!B{cellIndex}\");(INDEX(H:H;MATCH(ROW()-4;G:G;0)))))";我检查过/尝试过的:
SUM()或FIND()那样工作-> (-SUM工作,FIND不起作用)Excel向我展示了以下内容: Picture1
和这个: Picture2
图片2中的链接XML日志文件包含有关已删除部分的信息。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error035720_03.xml</logFileName><summary>Errors were detected in file 'C:\Users\XXX\Documents\Output\CodeBook.xlsx'</summary>
<removedRecords>
<removedRecord>Removed Records: Formula from /xl/worksheets/sheet.xml part</removedRecord>
<removedRecord>Removed Records: Formula from /xl/calcChain.xml part (Calculation properties)</removedRecord>
</removedRecords>
</recoveryLog>发布于 2016-10-17 15:09:22
不能使用分号(;)来分离closedxml中的参数。使用逗号(,)如下:
indexSheet.Cell("G" + cellIndex).FormulaA1 = "=FIND(\"erw\",H5)";这就是为什么SUM(range)有效的原因,但FIND(find_text;within_text)不.
发布于 2022-08-18 18:06:13
您必须使用逗号(,)来分隔持枪。不要像excel那样使用分号(;)
https://stackoverflow.com/questions/40088546
复制相似问题