Multiple saves creates blank excel file


I am currently using the demo version of Aspose Excel version I have run into a problem where a 2nd save creates a blank excel file. Here is some sample code:

Dim stream As New System.IO.MemoryStream(data)
_excelDocument = New Aspose.Excel.Excel

1.xls and 3.xls look fine. But 2.xls looks blank (except for the Evaluation Copyright Warning of course). Any ideas?



After Save method is called, Aspose.Excel discards all internal data. So you got blank file in the second call.


Any reason why it discards the data? Is there anyway to prevent it from discarding the data?


When calling Excel.Save method, many intermedia data are changed and many state data are updated. For performance consideration we don't roll them back. So we discard data to avoid problems.

If you want to preserve data, please use Excel.Copy method to make a copy before saving.

Excel excel1 = new Excel();

//do something here


Excel excel2 = new Excel();



excel1 = null;

Then you can use excel2 object for future use.


I tried this and save gives me an empty excel document. Is there a chance that the Copy call discards the internal data as well?


What's your sample code? Following is my detail code:

Excel excel1 = new Excel();


Excel excel2 = new Excel();




excel1 = null;


In book1.xls, you will see "hello" in A1. In book2.xls, you will see "hello" in A1 and "world" in A2.

Only after calling save method, excel1 and excel2 internally discard data.