版本大于2007 .xlsm文件无效 [英] Version greater than 2007 .xlsm file is not working

查看:91
本文介绍了版本大于2007 .xlsm文件无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中读取.xlsm文件并执行一些操作并将其保存到数据库中。当我使用从excel 2007保存的文件时,它工作正常,但每当我使用从大于2007的版本保存的excel文件时抛出异常。请建议我该怎么做才能解决这个问题?



我尝试过:



没什么......

解决方案

我建​​议使用ADO.NET [ ^ ] + OLEDB提供商 [< a href =https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/data-providerstarget =_ blanktitle =新窗口> ^ ]然后你将能够连接到MS Excel文件,将数据提取到 DataTable [ ^ ]对象,最后将其转储到数据库中。



详情请见:

Microsoft ACE OLEDB 12.0连接字符串 - ConnectionStrings.com [ ^ ]

从.NET访问Microsoft Office数据应用程序 [ ^ ]

I am reading .xlsm file in my application and perform some operation and saved it into database. When I am using file which is saved from excel 2007 it's working fine but whenever I used excel file which is saved from version greater than 2007 its throwing exception. Please suggest what can I do to resolve this issue ?

What I have tried:

Nothing...

解决方案

I'd suggest to use ADO.NET[^] + OLEDB provider[^] then you'll be able to connect to MS Excel file, fetch data into DataTable[^] object and finally dump it into database.

For further details, please see:
Microsoft ACE OLEDB 12.0 Connection Strings - ConnectionStrings.com[^]
Accessing Microsoft Office Data from .NET Applications[^]


这篇关于版本大于2007 .xlsm文件无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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