C# extract formatted text from Excel through OLEDB

若如初见. 提交于 2019-12-02 05:10:16

To the best of my knowledge, you cannot do this with just the ACE driver. That being said, if the constraints are ever lifted, this is the tool to use: http://closedxml.codeplex.com/

You should switch your approach to use open XML. It's .NET, not COM

Info: http://support.microsoft.com/kb/840817

Download SDK: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=5124

You have to use "Open Xml" to get to format information if you do not want to use Interop. There is no other choice. There is Biff which I mention only for correctness, but your connection string clearly indicates XML, so Biff is out.

Once you open through "Open Xml" then you can "simulate" reading the range/table/cells like a DataTable.

With your constraints, Only #1 will give you formatting information.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!