如何使用c#将上传的xlsx文件转换为xls文件 [英] How to Convert uploaded xlsx file to xls file using c#

查看:114
本文介绍了如何使用c#将上传的xlsx文件转换为xls文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



请允许任何人提供将 xlsx 文件转换为 xls 文件格式的解决方案。

在这里我可以上传 xls xlsx 格式,但问题是我需要同时保存 xls xlsx 仅将格式化为 xls 格式...



请帮忙,



先谢谢

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

推荐答案

以下是将xlsx转换为xls的简单代码



Here is the simple code to convert xlsx to xls

// 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 :)


这篇关于如何使用c#将上传的xlsx文件转换为xls文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆