Setting up VB.NET to work with Excel
来源:互联网 发布:java agent 哨兵 编辑:程序博客网 时间:2024/06/06 04:48
Click on File and click on New Project. Under Visual basic, Select “Windows” and then select “Windows Form Application”. Give the project an appropriate name and select a location where you want to save this project.
When the project opens you will be presented with Form1. For the time being just lets create 3 buttons and name then “Create”, “Open”, “Cancel”. Give an appropriate heading to the form. Your form should look like this.
Now let’s set references for Excel in our project. For this click on the menu Project~~>Add Reference. You will be presented with a “Add Reference”-dialog box. Navigate to the “COM” Tab and select the Microsoft Excel Object Library.
After setting the reference, double click on any of the button to open the Form1 Code Area and paste this line of code at the very top.
Imports
Excel = Microsoft.Office.Interop.Excel
Microsoft.Office.Interop.Excel
Microsoft.Office.Tool.Excel
将这些都加入进来
Double-click on the third button “Cancel” and paste the code. This is how your code should look like.
Imports
Excel = Microsoft.Office.Interop.Excel
Public
Class
Form1
Private
Sub
Button3_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button3.Click
Me
.Close()
End
Sub
End
Class
And you are all set for automating Excel From VB.Net.
- Setting up VB.NET to work with Excel
- <LearnWLS> Setting Up Examples to Run with a Derby Database
- Setting up Eclipse with Tomcat
- Setting up Spark with Gradle
- my.setting vb.net
- How to set up Tomcat 6 to work with JSTL 1.2
- Peer-to-Peer with VB .NET
- Setting up your Windows computer to run JPetStore 3.x with MySQL and Tomcat
- Setting Up Transmission-Daemon To Use With Remote GUI In Ubuntu And Debian
- Setting up automatic network installations with AutoYaST
- Setting Up Users with BIACM Application Roles
- Setting up Intellij with CyanogenMod/AOSP development
- Setting Boundaries with Others(摘录 work with passion)
- How to setting up ADSL under Ubuntu
- How to work with Ant
- Setting up Neutron-dhcp-agent & Dnsmasq on Two Node Neutron GRE+OVS F20 Cluster to launch VMs with M
- Setting Up and Working with Self-Service Transactions
- Setting up DirectX 11 with Visual Studio 2010
- 函数逼近与曲线拟合
- 模版:web.xml
- [概率dp] ZOJ 3822 Domination
- 左连接、右连接、交叉连接、全外连接
- 使用UDP和TCP协议的各种应用和应用层协议
- Setting up VB.NET to work with Excel
- 《记住回家的路》
- 《Systems Performance: Enterprise and the Cloud》读书笔记系列(八) —— 第二章(七)
- MongoDB(一)NoSQL起源
- csdn 博客 新手报到
- C#设计模式(5)——建造者模式(Builder Pattern)
- 模版:struts.xml
- HTML简介
- leetcode - Plus One