下面这段代码asp。net认不出类型Excel.ApplicationClass,请问应该import一些什么命名空间啊?
<%@ Import Namespace ="Microsoft.Office.Interop" %>是不行的。Dim oExcel as Excel.ApplicationClass
oExcel = new Excel.ApplicationClass()
oExcel.UserControl = falseExcel.WorkbookClass wb = CType( oExcel.Workbooks.Add( System.Reflection.Missing.Value ), Excel.WorkbookClass )
Dim i As Integer
For i = 1 To 4
oExcel.Cells[i,1] = i.ToString()
oExcel.Cells[i,2] = "第2列"
oExcel.Cells[i,3] = "第3列"
oExcel.Cells[i,4] = "第4列"
Next i

wb.Saved = true
Dim filename As string = Request.PhysicalApplicationPath & "write.xls"
oExcel.ActiveWorkbook.SaveCopyAs( filename )
oExcel.Quit()
System.GC.Collect()