Click here to Skip to main content
15,905,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

Please can anyone give the solution to Convert xlsx file to xls file format.
Here I am able to upload both xls and xlsx formats, but the thing is I need to Save both xls and xlsx formated files into xls format only ...

please help,

Thanks in Advance
Posted

1 solution

Here is the simple code to convert xlsx to xls

C#
// Create new XLSX file.
var xlsxFile = new ExcelFile();

// Load data from XLSX file.
xlsxFile.LoadXlsx(fileName + ".xls", XlsxOptions.PreserveMakeCopy);

// Save XLSX file to XLS file.
xlsxFile.SaveXls(fileName + ".xls");


Hope it will solve your problem :)
 
Share this answer
 
Comments
GaviGunda 28-Mar-13 8:45am    
I tried this code but it shows many errors at LoadXlsx and XlsxOptions and SaveXls...
could you please tell what namespaces/libraries/Assemblies I need to include
T Pat 28-Mar-13 9:09am    
use this library http://www.gemboxsoftware.com/spreadsheet/overview
GaviGunda 30-Mar-13 1:22am    
I need to do only by using .net technology. External software I don't want to use. Please can you tell how to do without using external libraries/software.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900