Hi,
I’m trying to save a workbook which contains some macros and a dynamic range. This worksheet has 3 worksheets. If I write this code everything goes fine:
Workbook wb = new Workbook(Server.MapPath("~") + “workbook/ETAT1 - Compte de résultat v2_0.xlsm”);
wb.Save(“C:/test.xlsm”);
However if I delete the third worksheet before Save, it causes a corrupted file :
Workbook wb = new Workbook(Server.MapPath("~") + “workbook/ETAT1 - Compte de résultat v2_0.xlsm”);
wb.Worksheets.RemoveAt(2);
wb.Save(“C:/test.xlsm”);
I have attached to this post a sample project which shows the issue.
Thanks for your help,