If I repeatedly open certain worksheet (xlsx) for two times, any xlsx file subsequently saved (in the same apps) would not be readable by Excell (unless I let Excel to recover/repair it). Example codes:
wbSource1.Workbook.ReadFromFile('test.xlsx');
wbSource1.Workbook.Clear;
wbSource1.Workbook.ReadFromFile('test.xlsx');
wbSource1.SaveToSpreadsheetFile('test1.xlsx');
// files attached: test.xlsx can be opened in Excel. test1.xlsx need to be
// repaired before Excel open it.
After few hours of testing, I found that::-
I) within test.xlsx there is a file called custom.xml which contains some custom properties. These properties are duplicated twice (eg. 4 items would became 8 items) in test1.xls. Hence test1.xlsx cannot be read by Excel (Libreoffice has no issue with test1.xlsx - I guess Libreoffice would ignore/automatically remove duplicate properties).
II) I can manually delete custom.xml and solve the above issue i.e. by opening the excel file (as archive) using 7zip.
My questions:
How can I prevent the above issue?
How do I remove the duplicate properties (or remove all this unwanted properties) programatically in fpSpread ?
.