zugock said 2 years, 4 months ago:
I found that when i assign a formula in a cell, say :
cell[1, 1].Formula = "1+1″;
the value of the cell (cell[1,1].value) is null.
even i save the file and then reload the file, the value is null.
I can only get the right value (in this case "2″) if i open the saved file by Micrsoft EXCEL
and then save it again with Micrsoft EXCEL.
After the above step, when i open the file again by the C1Excel, it can get the value "2″.
Is there any method that help me to get the calculated value without using Micrsoft EXCEL?
Thank a lot,
Reeva6p said 2 years, 4 months ago:
I am not sure which build you are using but this was a known issue wherein cell having formulas are not retained if the cell has no prior value. Hence, in case you are using the older build then as a workaround I would request you to set Value property of the same cell to zero before setting up the formula.
private void Form1_Load(object sender, EventArgs e)
xls = new C1XLBook();
XLSheet sheet = xls.Sheets;
XLCell acell = sheet[0, 0];
acell.Value = 0;
acell.Formula = "1+1″;
} and then save
However, the issue stated by you works perfectly fine in our latest build without even using Value property anyhow. Hence I would request you to upgrade the same to the latest build.
Latest build can be found at the below mentioned locations:-
Hope that helps.
You must be logged in to reply to this topic.