所以..首先
将Referente添加到您的项目到Microsoft.Office.Interop,在COM部分
在您的表格中
Imports Microsoft.Office.Interop.Excel
Imports Microsoft.Office.Interop
并使用
Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim xlWorkBook As Microsoft.Office.Interop.Excel.Workbook
Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet
xlApp = New Microsoft.Office.Interop.Excel.Application
xlWorkSheet = xlWorkBook.Sheets("sheet1")
'在工作表上写一些
'并保存它!
xlWorkSheet.SaveAs("D:\Reports\" & worker & Id & ".xlsx")
xlWorkBook.Close()
xlApp.Quit()
releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)