string filename = this.openFileDialog2.FileName;
string filePath = this.openFileDialog1.FileName;
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;
oExcel = new Microsoft.Office.Interop.Excel.ApplicationClass();
oExcel.UserControl = false;
Microsoft.Office.Interop.Excel.WorkbookClass wb = (Microsoft.Office.Interop.Excel.WorkbookClass)oExcel.Workbooks.Add(System.Reflection.Missing.Value);
oExcel.Cells[1, 2] = "第二列";
oExcel.Cells[1, 3] = "第三列";
oExcel.Quit();
System.GC.Collect();
E_iceblue 4 年前
很好,收藏了 2010-04-23
害羞的蜗牛 2008-12-18
有一个问题 2008-09-22