Dim xlApp As New Excel.Application '定义数据库记录集及excel对象变量
Dim xlBook As New Excel.Workbook
Dim xlSheet As New Excel.Worksheet
Pname = App.Path & "\report\temp.xls" '定义临时打印工作表
reStr = Dir(Pname)
If reStr <> "" Then
Kill Pname
End If
FileCopy App.Path & "\report\局报一.xls", Pname
If Not (xlApp Is Nothing) Then
xlApp.Quit
End If
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open(App.Path & "\report\temp.xls")
Set xlSheet = xlBook.Worksheets("报表一")
for i=0 to 22
next i
xlBook.Save
xlApp.Quit
Deal_err:
If Err.Number <> 0 And Err.Number <> 429 Then
MsgBox "信息号" & Err.Number & ":" & Err.Description, 64, "详细信息"
Err.Number = 0
ElseIf Err.Number = 429 Then
MsgBox "请先安装Office2000,在运行此程序!", 64
Err.Number = 0
End If