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.
var workbook = new Workbook(@"\test.xlsx");
var ws = workbook.Worksheets;
Cells cells = ws.Cells;
cells.ClearContents(cells.MinRow, cells.MinColumn, cells.MaxRow, cells.MaxColumn);
var newWorkbook = new Workbook(@"\test2.xlsx"); // reopen the saved xlsx
newWorkbook.Worksheets.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?