We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Saving and opening the file in aspose.cells.net 21.12.0 version dll

Hi ,
We have just downloaded the aspose.cell.net version 21.12.0 , We are using the xlt template to update the data and open it in browser. we are using the following code objExcel.Save(Me.Response, “StandardReport.xlsx”, ContentDisposition.Attachment, New XlsSaveOptions(FileFormatType.Xlsx))​. which is giving obselete error . if the user has 2007 version we are using the extendsion xlsx , otherwise xls . I we want to know the correct code in vb.net for the saving options . We never had the issue in the previous version aspose.cell dll 20.12 . We have .net frame work 4.0 . ​
Thanks for your help


XlsSaveOptions is used for excel97-2003 file formats only. Using it for other formats may cause ambiguity and unexpected behavior, so we make it obsolete in newer versions. To save xlsx files, please use new OoxmlSaveOptions (SaveFormat.Xlsx) instead.

Thank you , So you are saying Aspose.cells for .net version dll 21.12.0 will not working on saving the options for 97-2003 excel . Also we are copying one workbook to another before saving and opening in browser . In version 20.12.0 dll copying the populated charts and formulas were the issue . Those were not copied properly to the new work book . Is there any new code change in copying one work book to another .
Thanks for your help


If you want to save to XLSX file format, then yes, you need to use the line of code instead:
objExcel.Save(Me.Response, “StandardReport.xlsx”, ContentDisposition.Attachment, New OoxmlSaveOptions (SaveFormat.Xlsx))

There is not any significant code change in newer version. Please try our latest version/fix: Aspose.Cells for .NET 22.1. If you still find the issue, kindly do share a sample project (runnable) with resource files to reproduce the issue on our end, we will check it soon.

PS. please zip the project prior attaching. Also, do no include Aspose.Cells.Dll in the archive to minimize the size of the project.

Hi is excel versions 1997 , 2000, 2002, 2003 is supported to save as xls file instead of xlsx allowed in 21.12 or 22.1 aspose.dll . Then what is the saving format when uoprning the file in browser

See the following lines of code with comments for your reference:
Sample code:

//Save the XLSX file to be opened (as attachment) via Response object on client end  
objExcel.Save(Me.Response, “StandardReport.xlsx”, ContentDisposition.Attachment, New OoxmlSaveOptions (SaveFormat.Xlsx))

//Save the XLS file to be opened (as attachment) via Response object on client end  
objExcel.Save(Me.Response, “StandardReport.xls”, ContentDisposition.Attachment, New XlsSaveOptions(SaveFormat.Excel97To2003))

Hope, this helps a bit.

The above code works for previous versions . We use then xlt to populate the data and open in the browser. We have the code that copy from one work book to another work before opening . There are some template which has formulas and charts . After copying to a new workbook , i see some charts data and some formulas are not copied properly . This is not changed in 21.12 dll also . To populate the formula , why do we have to call Oexcel.calculateformua method.
Thanks for your help.


For XLT, you will use the same line.

Calling CalculateFormula is always good thing, so the updated/calculated values should be copied over. Do you find any issue when calling Workbook.CalculateFormula() method?

While using this for saving previous version , i get a warning , this is obselete., this property will be removed later 12 months from jan 2021
Please give the correct format for previous version. We are using 21.12 dll


Please try using the line instead:
objExcel.Save(Me.Response, “StandardReport.xls”, ContentDisposition.Attachment, New XlsSaveOptions())