Hello. I have a problem with the recording of the formula in the cell. Formula - "=IF(A6>$A$4;0;1-(E6+F6)/C6)".
Sample Code:
var workbook = new XLWorkbook();
var worksheets = workbook.Worksheets.Add("Sheet 1");
worksheets.Cell(4, 1).Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
worksheets.Cell(6, 1).Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
worksheets.Cell(6, 3).Value = "3";
worksheets.Cell(6, 5).Value = "5";
worksheets.Cell(6, 6).Value = "6";
worksheets.Cell(2, 2).FormulaA1 = "=IF(A6>$A$4;0;1-(E6+F6)/C6)";
workbook.SaveAs("123.xlsx");
When opening a file I get an error - "Excel found unreadable content in '123.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes."
Offline formula in cell (2, 2). Tell me what am I doing wrong?
Sample Code:
var workbook = new XLWorkbook();
var worksheets = workbook.Worksheets.Add("Sheet 1");
worksheets.Cell(4, 1).Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
worksheets.Cell(6, 1).Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
worksheets.Cell(6, 3).Value = "3";
worksheets.Cell(6, 5).Value = "5";
worksheets.Cell(6, 6).Value = "6";
worksheets.Cell(2, 2).FormulaA1 = "=IF(A6>$A$4;0;1-(E6+F6)/C6)";
workbook.SaveAs("123.xlsx");
When opening a file I get an error - "Excel found unreadable content in '123.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes."
Offline formula in cell (2, 2). Tell me what am I doing wrong?