i tried to use openxml's changedocumenttype to convert xlsm to xlsx file,
but when it was done, i cannot open it , the office showed me the xlsx file was broken.
who can tell me why was that? this is the code:
//convert xlsm to xlsx
using (SpreadsheetDocument myDoc = SpreadsheetDocument.Open(xlsmPath, true))
{
myDoc.ChangeDocumentType(SpreadsheetDocumentType.Workbook);
}
but when it was done, i cannot open it , the office showed me the xlsx file was broken.
who can tell me why was that? this is the code:
//convert xlsm to xlsx
using (SpreadsheetDocument myDoc = SpreadsheetDocument.Open(xlsmPath, true))
{
myDoc.ChangeDocumentType(SpreadsheetDocumentType.Workbook);
}