2
信息識別的公式:下面的代碼是在foreach循環Excel中不從closedXML/C#
作品:
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)))))";
我檢查/嘗試:
- 因爲在計算器存在類似的情況:如果我的函數語言與我的Excel語言匹配(均爲英文)
- 我想,如果簡單的公式會工作像
SUM()
或FIND()
- >(-sum工作,找不工作) - 我直接輸入公式在excelsheet(公式在這裏工作)
- 我試了一下,從外面河套用硬編碼細胞信息和沒有「細胞索引」變量
- 白衣等號的公式的開始,沒有它
- 我試着用closedXML弗斯簽出closedXML的文檔。 0.76.0和0.80.1(最新的穩定)
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>