读取表格中有。(点)的excel表格 [英] read excel sheet which has .(dot) in the sheet

查看:135
本文介绍了读取表格中有。(点)的excel表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用Excel对象和Oledb SqlDataAdapter读取excel文件。

当工作表名称包含特殊字符时。(点), - (连字符)它抛出以下错误。



 Microsoft Access数据库引擎找不到 object  ' ' 7月 - 文件$ '  A2:F1048576'。确保对象存在,并且您正确拼写其名称和路径名称。如果' ' July- File $ '  A2:F1048576'  不是本地对象,检查您的网络连接或联系服务器管理员。

解决方案

' A2:F1048576'。确保对象存在,并且您正确拼写其名称和路径名称。如果' ' July- File


' A2:F1048576' 不是本地 object ,检查您的网络连接或联系服务器管理员。


我建​​议不要使用OleDb来阅读Excel 。它是.Net中微软的继子女之一。您在那里描述的错误是典型的。看看这些替代方案(有些只允许编写Excel文件,我已经编译了这个列表并保持原样):



免费导出到ExcelC#类,使用OpenXML [< a href =http://www.codeproject.com/Articles/692092/A-free-Export-to-Excel-Csharp-class-using-target =_ blanktitle =New Window> ^ ]

ExcelExportLib [ ^ ]

EPPlus [< a href =http://epplus.codeplex.com/target =_ blanktitle =New Window> ^ ]

excellibrary [ ^ ]

NPOI
[ ^ ]

ExcelPackage [ ^ ]

ExML [ ^ ]

使用NPOI读取和写入Excel文件内容而不使用Excel自动化 [ ^ ]

SmartXLS [ ^ ]

OpenXML [ ^ ]

为Microsoft Office打开XML SDK 2.0 [ ^ ]



编辑:错字

Hi,

I am reading a excel file using Excel object and Oledb SqlDataAdapter.
When the sheet name contains special char like .(dot),-(hyphen )it's throwing the following error.

The Microsoft Access database engine could not find the object ''July - File$'A2:F1048576'. Make sure the object exists and that you spell its name and the path name correctly. If ''July- File$'A2:F1048576' is not a local object, check your network connection or contact the server administrator.

解决方案

'A2:F1048576'. Make sure the object exists and that you spell its name and the path name correctly. If ''July- File


'A2:F1048576' is not a local object, check your network connection or contact the server administrator.


I would recommend to not use OleDb for reading Excel. It's one of Microsofts stepchildren in .Net. The error you're describing there is typical. Take a look at these alternatives (some only allow for writing Excel files, I had this list already compiled and leave it as it is):

A free "Export to Excel" C# class, using OpenXML[^]
ExcelExportLib[^]
EPPlus[^]
excellibrary[^]
NPOI
[^]
ExcelPackage[^]
ExML[^]
Read and Write Excel Files Content without Excel Automation using NPOI[^]
SmartXLS[^]
OpenXML[^]
Open XML SDK 2.0 for Microsoft Office[^]

edit: typo


这篇关于读取表格中有。(点)的excel表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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