<%
'1、创建EXCEL对像
set objExcelApp = CreateObject("Excel.Application")
objExcelApp.DisplayAlerts = false '不显示警告
objExcelApp.Application.Visible = false '不显示界面
'2、 新建Excel文件
objExcelApp.WorkBooks.add
set objExcelBook = objExcelApp.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets(1)
'3、 读取已有Excel文件
strAddr = Server.MapPath(".")
objExcelApp.WorkBooks.Open(strAddr & "/excel/Report.xls")
set objExcelBook = objExcelApp.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets(1)
'4、 另存Excel文件
SaveName = "交换机_"&year(now())&month(now())&day(now())&hour(now())&minute(now())&second(now())
objExcelBook.SaveAs strAddr & "/excel/