Dim ExcelSheet
Set ExcelSheet = CreateObject("Excel.Sheet")
ExcelSheet.Application.Visible = True
ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1"
ExcelSheet.SaveAs "C:\DOCS\TEST.XLS"
ExcelSheet.Application.Quit
Set ExcelSheet = Nothing
以上是QTP帮助文档中的实例。