最近用到了,共享下
1:引用设置
![0cd350533836de16cd7daf9713ccde3a.png](https://i-blog.csdnimg.cn/blog_migrate/1e9f36c503ff514753cf2cf81bc9c11c.png)
2:类内using
using Excel = Microsoft.Office.Interop.Excel;
//因为该命名空间内,有很多名称与Forms内的相同,为了区分
3.最基本的访问代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
//因为该命名空间内,有很多名称与Forms内的相同,为了区分
namespace ExcelCom
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void butt