在没有安装office的情况下,在c#中导入xls的xlsx文件。

时间:2023-01-15 10:45:47

I've got one simple question.

我有一个简单的问题。

Can I import xls and xlsx file to my web application based on ASP MVC5, using Microsoft.ACE.OLEDB.12.0 provider without having any version of Microsoft Office installed?

我是否可以将xls和xlsx文件导入到基于ASP MVC5的web应用程序中,使用microsoft.ac . oledb .12.0提供程序,而无需安装任何版本的Microsoft Office ?

4 个解决方案

#1


1  

Yes. The OLEDB provider does not have a dependency on the Excel application.

是的。OLEDB提供程序不依赖于Excel应用程序。

#2


0  

You could also use EPPlus library for reading (and writing) XLSX files:

您还可以使用EPPlus库来读取(和写入)XLSX文件:

http://epplus.codeplex.com/

http://epplus.codeplex.com/

The drawback is it only works with 2007/2010 Excel versions (and I think 2013 also), so it doesn't have support for xls files, only xlsx.

缺点是它只支持2007/2010 Excel版本(我认为2013年也是),所以它不支持xls文件,只支持xlsx。

#3


0  

Another option that I can endorse is ClosedXml. This is a much more friendly wrapper around Microsoft's OpenXML SDK. I'm not familiar with EPPlus, but Closed XML also only supports .xslx.

我可以支持的另一个选项是ClosedXml。这是一个更加友好的包装,围绕着微软的OpenXML SDK。我不熟悉EPPlus,但是Closed XML也只支持.xslx。

#4


0  

You can install only the driver if this is possible in your case or use another library that supports reading Excel files and it is not dependent by MS Office installation at all. You can use EasyXLS library that handles both xls and xlsx files:

如果可能的话,您只能安装驱动程序,或者使用另一个支持读取Excel文件的库,而且完全不依赖于MS Office安装。您可以使用EasyXLS库来处理xls和xlsx文件:

http://www.easyxls.com/net-excel-library

http://www.easyxls.com/net-excel-library

#1


1  

Yes. The OLEDB provider does not have a dependency on the Excel application.

是的。OLEDB提供程序不依赖于Excel应用程序。

#2


0  

You could also use EPPlus library for reading (and writing) XLSX files:

您还可以使用EPPlus库来读取(和写入)XLSX文件:

http://epplus.codeplex.com/

http://epplus.codeplex.com/

The drawback is it only works with 2007/2010 Excel versions (and I think 2013 also), so it doesn't have support for xls files, only xlsx.

缺点是它只支持2007/2010 Excel版本(我认为2013年也是),所以它不支持xls文件,只支持xlsx。

#3


0  

Another option that I can endorse is ClosedXml. This is a much more friendly wrapper around Microsoft's OpenXML SDK. I'm not familiar with EPPlus, but Closed XML also only supports .xslx.

我可以支持的另一个选项是ClosedXml。这是一个更加友好的包装,围绕着微软的OpenXML SDK。我不熟悉EPPlus,但是Closed XML也只支持.xslx。

#4


0  

You can install only the driver if this is possible in your case or use another library that supports reading Excel files and it is not dependent by MS Office installation at all. You can use EasyXLS library that handles both xls and xlsx files:

如果可能的话,您只能安装驱动程序,或者使用另一个支持读取Excel文件的库,而且完全不依赖于MS Office安装。您可以使用EasyXLS库来处理xls和xlsx文件:

http://www.easyxls.com/net-excel-library

http://www.easyxls.com/net-excel-library