源代码:
Dim xlApp As New Application
Dim xlBook As Workbook
Dim xlSheet As Worksheet xlApp = CType(CreateObject("Excel.Application"), Application) '创建EXCEL对象
xlBook = xlApp.Workbooks.Add()
xlApp.Visible = False
xlSheet = CType(xlBook.Worksheets("sheet1"), Worksheet) '设置活动工作表
Dim i As Integer = 2
xlSheet.Range("a" & i).Resize(5).Value = "test1"
xlSheet.Cells(1, 1) = "test2"
xlSheet.Cells(1, 2) = "test21"
xlSheet.Cells(2, 3) = "test22"
xlBook.SaveAs("d:\" & Now.ToString("yyyyMMddHmmss") & ".xls")
xlApp.Workbooks.Close()
xlApp.Quit()
Application.Clear()这段代码在VS2005能正常运行。
放到服务器上就出现至少一个参数没有被指定值了。服务器是Windows Server 2003 Edition ,已经安装了Imports Microsoft.Office.Interop.excel,在C:\WINDOWS\assembly上也能找到它。这样算是安装成功了吗?
不管有没有遇到这样的问题,希望大家能积极发言。谢谢!
使用低版本EXCEL
此处缺少参数