Private Sub cmdSwatch_Click()
Dim xls As excel.Application
Dim xlbook As excel.Workbook
''On Error GoTo exlError
Dim i As Integer
If Dir(Text1.Text) <> "" Then ''此目录下如有同名文件给出提示,并作相应处理
If MsgBox("文件已存在,是否覆盖!", vbYesNo + vbQuestion, "另存为工程造价文件") = vbNo Then
Exit Sub
Else
Kill (Text1.Text) ''删除文件
End If
End If
''************打开工作表***************
Set xls = New excel.Application
xls.Visible = True
Set xlbook = xls.Workbooks.Add
''*********************************
For i = 0 To 14
If Check2(i).Value = vbChecked Then
Select Case i
Case 8
ToExcelJDanJiaSum.ToExcelJDanJiaSum xlbook, xls
Case 9
ToExcelADanJiaSum.ToExcelADanJiaSum xlbook, xls
Case 10
ToExcelCailiao.ToExcelCailiao xlbook, xls
Case 11
ToExcelTsf.ToExcelTsf xlbook, xls
Case 12
ToExcelZgcl.ToExcelZgcl xlbook, xls
End Select
End If
Next
For i = 0 To 6
If Check3(i).Value = vbChecked Then
Select Case i
Case 0
ToExcelMan.ToExcelMan xlbook, xls
&