Answered by:
Convert xls into xlsx

Question
-
Hi,
I have my data in .xls format however my application uses .xlsx file.
When I try to save the .xls file with .xlsx extension, it gets corrupted.
Kindly suggest a way to do this.
SA1234
- Moved by CoolDadTx Monday, July 1, 2013 2:03 PM Office related
Monday, July 1, 2013 1:50 PM
Answers
-
XLS is the older Excel file format. XSLX is the newer format stored as OpenXML. XSLX is actually a zip file with the various components stored as files within it. You cannot simply rename the file to get it into the new format. To save the file in XSLX you'll have to save the file into the Excel 2010+ format. If you're using Excel interop then it is an option on the SaveAs method.
Michael Taylor
http://msmvps.com/blogs/p3net
- Proposed as answer by Damon Zheng Tuesday, July 2, 2013 1:05 PM
- Marked as answer by Damon Zheng Wednesday, July 17, 2013 7:29 PM
Monday, July 1, 2013 2:02 PM
All replies
-
XLS is the older Excel file format. XSLX is the newer format stored as OpenXML. XSLX is actually a zip file with the various components stored as files within it. You cannot simply rename the file to get it into the new format. To save the file in XSLX you'll have to save the file into the Excel 2010+ format. If you're using Excel interop then it is an option on the SaveAs method.
Michael Taylor
http://msmvps.com/blogs/p3net
- Proposed as answer by Damon Zheng Tuesday, July 2, 2013 1:05 PM
- Marked as answer by Damon Zheng Wednesday, July 17, 2013 7:29 PM
Monday, July 1, 2013 2:02 PM -
An easy way to save you the trouble is to open two excel application and copy each sheet of your original XLS file in the new excel workbook then save it as XLSX.
Please do not forget to click “Vote as Helpful” if the reply helps/directs you toward your solution and or "Mark as Answer" if it solves your question. This will help to contribute to the forum.
Monday, July 1, 2013 5:01 PM -
Hi, if your application is targeting .NET framework then you can try this .NET Excel component.
It has a really simple API for converting XLS to XLSX in C# / VB.NET so it can enable you to use both file formats with ease:
ExcelFile.Load("Workbook.xls").Save("Workbook.xlsx");
Thursday, July 11, 2013 8:05 AM