如何使用数据网格视图在 Windows 应用程序中显示扩展名为 .xlsx 的 Excel 数据?
我有一个 Excel 文件,我想将其加载到表单中并显示在那里。有什么办法可以做到这一点吗?抱歉,我对 Visual Studio 和 Visual Basic 都很陌生。如果有人能帮助我解决这个问题,那就太好了。
I have an excel file that I would like to load into my form and display there. Is there any way to do this? Sorry I am fairly new at visual studio as well as visual basic. If anybody could help me out with this it would be great thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几个选项 - 所有选项都涉及一些附加库:
OpenXML 2.0(MS 的免费库)可用于读取/修改 .xlsx 的内容,以便您可以以任何方式显示它(例如在数据网格视图中)
一些(商业)第 3 方库附带网格控件,允许您在应用程序中显示 excel 文件(无论是Winforms/WPF/ASP.NET...) 例如 SpreadsheetGear、Aspose.Cells 等
There are several options - all involve some additional library:
OpenXML 2.0 (free library from MS) can be used to read/modify the content of an .xlsx so you can display it anyway you want (for example in a data grid view)
some (commercial) 3rd-party libraries come with grid controls allowing you to display excel files in your application (be it Winforms/WPF/ASP.NET...) like SpreadsheetGear, Aspose.Cells etc.