在Visual Studio中使用Excel文件 [英] Working with Excel files from within Visual Studio

查看:636
本文介绍了在Visual Studio中使用Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Visual Studio创建一个小的项目,该项目可以打开并与Excel工作簿一起使用.我希望能够访问工作簿中的单个工作表,并且还能够访问每个工作表中的单个单元格.

目前,我正在尝试使用VBA方法,例如"Workbooks()","Worksheets()","Cells()"等,但看来我无法执行此操作.

我试图编写的应用程序"用于为各个部门预订和分配文件编号.文档编号数据存储在Excel工作簿中. Visual Studio(VB)应用程序用于访问该工作簿中的工作表和单元格.

Thx
YYC AB

I am trying to create a small project with Visual Studio that opens and works with an Excel workbook. I would like to be able to access individual worksheets within the workbook and the also access individual cells within each worksheet.

At the present I am trying to use VBA methods such as "Workbooks()", "Worksheets()", "Cells()", etc. but it seems I am not able to do this.

The "application" I am trying to write is for reserving and assigning document numbers for various departements. The document numbering data is stored in an Excel workbook. The Visual Studio (VB) appplication is used to access the worksheets and cells within that workbook.

Thx
YYC AB

推荐答案

互联网上确实有大量文章-
http://support.microsoft.com/kb/302084 [ http://www.davidhayden.com/blog/dave/archive/2006/05/26/2973.aspx [ ^ ]
http://dotnetperls.com/excel-interop [
There really are tons of articles available on the internet -
http://support.microsoft.com/kb/302084[^]
http://www.davidhayden.com/blog/dave/archive/2006/05/26/2973.aspx[^]
http://dotnetperls.com/excel-interop[^]


这篇关于在Visual Studio中使用Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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