Dim App As New MSExcel.Application Dim Wb As MSExcel.Workbook =
App.WorkBooks.Add Wb.WorkSheets(1).name =
"hhh" Wb.WorkSheets(1).range("A1").Value =
"hhh123" Wb.SaveAs("d:\123.xls") App.Quit
2、这是excel报表一章时对文件的引用
Dim Book As New XLS.Book("c:\reports\test.xls") Dim Sheet1 As XLS.Sheet =
Book.Sheets(0) Book.Sheets.Add() '增加一个工作表 Dim Sheet2 As XLS.Sheet = Book.Sheets(1) '引用新增加的