MiniExcel
MiniExcel copied to clipboard
write formula to Excel, formula treated as string
Excel Type
- [x] XLSX
- [ ] XLSM
- [ ] CSV
- [ ] OTHER
Upload Excel File
MiniExcel Version
1.34.1
Description
When you directly output formulas to an Excel file using MiniExcel, and then save it as a new file, the cells containing the formulas are treated as regular data, and the formulas themselves do not work. The formulas only become active after you manually enter the cells, edit the formulas, and press Enter.
And, I can’t find the relevant settings and instructions in the instructions for use in the readme.
var data = new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
["Institution"] = "Institution",
["Created"] = "Created",
["Formula"] = "Formula",
},
new Dictionary<string, object>
{
["Institution"] = "BMC Inc.",
["Created"] = "2021-01-01",
["Formula"] = $"=SUM(A2:B2)"
},
};
MiniExcel.SaveAs("test.xlsx", data, printHeader: false, overwriteFile: true, excelType: ExcelType.XLSX);
Functionality waiting for Pull Request. PR 679: Formula Support