Could you please guide me on how to save the Excel file in 2007, 2010, 2013 Excel format using ASPOSE. And how to differentiate the File version once it get saved.
All three versions of MS Excel (2007, 2010, 2013) support similar file formats (e.g XLS, XLSX, XLSM, XLSB, CSV, Tab Delimited etc.). There is no differentiation regarding in which MS Excel the file was generated, all MS Excel versions (2007, 2010, 2013) do open the above mentioned file formats fine. Aspose.Cells support all the file formats that MS Excel (97-2010/2013) supports, see the following sample code for your reference:
e.g
Sample code:
//Create a new workbook
Workbook workbook = new Workbook();
//…
/…Your code goes here.
//…
workbook.save(“out1.xlsx”, SaveFormat.XLSX); //save the Excel file.
But as per my understanding 2013 excel file is something diffrener=t than 2010 file. If we save file using 2013 then will get that format or it will appear as like 2007,2010 file only.
Well, using any of the MS Excel versions (i.e., 2007, 2010 or 2013), you would use XLS, XLSX, XLSM, XLSB, CSV, Tab Delimited etc. file format to save the file. A file created in MS Excel 2013 would be equally opened fine into MS Excel 2007 or 2010. Moreover, there are some new features and other enhancements that you may use only in MS Excel 2013 regarding data analysis, charting, formulas etc. If you have used those new features in MS Excel 2013 file (e.g XLSX), now when you open the file into MS Excel 2007/2010, the relevant objects (for new features/enhancements) would be skipped but MS Excel 2007/2010 would display the file fine.
Well, I am afraid, there is no such API available to evaluate in which version of MS Excel (2007, 2010, 2013) a file is created. But, I think you can easily check this in “workbook.xml” file by yourself, if there is an element like following:
…
, you can get the file version by evaluating the number such as 4 or 5 or 6… etc. For example, 4 refers to Excel 2007, 5 refers to Excel 2010 and so on.
Well, XLSX is actually zipped format, so, I think you may extract the XLSX file via some zipped utility, then use your own JAVA code to open workbook.xml file.
Do you mean to say that you have a template XLSX file that was created in Excel 2013 manually and you use Aspose.Cells to re-save it, it saves in Excel 2007 (with lastEdited=“4”) format, could you provide the template file here, we will check it soon.
By the way, if you are creating new file (from the scratch), Aspose.Cells would save it in Excel 2007 file format version by default and this is correct behavior.
My server have one template .XLSX file. Java code use to copy that template and then save it as EXCEL-2007, 2010, 2013 format as per user requirement.
So my code is not creating any file from scratch, it just copying existing file and saving as expected format.
but if I want to save it in excel 2013 format, its saved in 2007 format. Plz help
I have one template .xlsx file which have lastEditited=“4”(2007). I used to populate data ino this xlsx file and want to save into EXCEL-2007, 2013, 2013 format as per user requirement.
Well, if a template XLSX file is created in MS Excel 2007, then when you re-save it it would also be in that format. And, if the template file is created in Excel 2013 and then you re-save it, it would be in Excel 2013 format.
PS. I am afraid, we do not provide any API to check or update App version.