Hi,
My workbook has a chart where the axis title references to a cell in the data worksheet. I noticed that if I clear the cell, save the workbook and reopen it, the axis title reference will be removed. This is not the same behaviour in MS Excel, where even if the cell content is empty, the reference is preserved so that if I type in text on the cell again, the axis title will reapear.
Code:
var workbook = new Workbook(@"\test.xlsx");
var ws = workbook.Worksheets[1];
Cells cells = ws.Cells;
cells.ClearContents(cells.MinRow, cells.MinColumn, cells.MaxRow, cells.MaxColumn);
workbook.Save(@"\test2.xlsx");
var newWorkbook = new Workbook(@"\test2.xlsx"); // reopen the saved xlsx
newWorkbook.Worksheets[1].Cells[“E4”].PutValue(@“test”); // apply the text to the referenced cell
newWorkbook.Save(@"\out.xlsx"); // axis title missing
I’ve attached the test files and a recording of MS Excel behaviour for your reference. Could you please take a look?
test.zip (1.6 MB)
image.png (28.1 KB)
Thanks,