我想用vs2005在windows 应用程序里操作excel文件,我创建了一个windows application程序,并且在project reference 里增加了C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE 和 using System.Microsoft.Office.但是在输入代码 Microsoft.Office.Interop.Excel.ApplicationClass 创建对象时,报Interop没有引入。请问怎样解决此问题?谢谢
string filepath = openFileDialog1.FileName;
string name = filename.Substring(filename.LastIndexOf("\\")+1,filename.Length-filename.LastIndexOf("\\")-1);
//label1.Text = name.ToString();
//label1.Text = filepath.ToString(); OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+filepath+";Extended Properties=\"Excel 8.0;\"");
conn.Open();
Microsoft.Office.Interop.Excel.ApplicationClass oExcel;//不能调出Interop
oExcel = new Microsoft.Office.Interop.Excel.ApplicationClass();
----在这就出错了
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.Common;
using Microsoft.Office.Core;//office后面只有Core 没有其他的了
using Microsoft.Office;
我把这些都加进去了
我没搜到Interop.Excel.dll文件