如何在vb.net中附加Excel工作表 [英] how to attach excel sheet in vb.net

查看:101
本文介绍了如何在vb.net中附加Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在vb.net上使用excel工作表

解决方案

由于您对所做的事情非常不确定,因此请查看此自动化Excel [ ^ ]


VB.NET中的Excel连接 [ ^ ]可能会帮助您入门.

假设您将为您的应用程序创建一个加载项.
导入以下内容:

 导入 xl = Microsoft.Office.Interop.Excel

 Dim  xlApp  as  xl.Application;
xlApp = Globals.ThisAddin.Application ' 获取应用程序对象
 Dim 工作簿 As  xl.WorkBook = xlApp.ActiveWorkbook ' 获取活动的工作簿对象
 Dim 工作表 As  xl.WorkSheet = workbook.ActiveSheet ' 获取活动的工作表对象 


现在,您可以按需要使用工作表的属性.

但是,如果您想打开一个简单的工作簿,则只需执行以下操作:

Process.Start("excel")


I want to use excel sheets with vb.net

解决方案

As you are very vauge about what you are after doing have a look at this Automate Excel[^]


Excel Connectivity in VB.NET[^] may help you get started.


Assuming that you will be creating an Add-in for your application.
Import the following:

Imports xl = Microsoft.Office.Interop.Excel

Dim xlApp as xl.Application;
xlApp = Globals.ThisAddin.Application                 'Get the application object 
Dim workbook As xl.WorkBook = xlApp.ActiveWorkbook    'Get the active workbook object
Dim worksheet As xl.WorkSheet = workbook.ActiveSheet  'Get the active worksheet object


Now you can use the properties of your worksheet in the way you want.

However if you want to open a simple workbook, then you can simply do this :

Process.Start("excel")


这篇关于如何在vb.net中附加Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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