我在程序中调用了excel,打开一个文件然后保存退出,不打开excel窗体。但是在调用.quit函数之后,excel仍然在进程表中存在,请教如何在不打开excel的情况下将它从进程表关掉,多谢多谢。我调用的代码如下: '建立Excel对象
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
objExcel.Workbooks(1).Sheets.Add
If bFlag(0) Then
If Not ExportYearCountyPeopleToExcel(objExcel, objPeopleGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If
If bFlag(1) Then
If Not ExportYearCountyCroupToExcel(objExcel, objCroupGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If
If bFlag(2) Then
If Not ExportYearCountyeExpenseToExcel(objExcel, objExpenseGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If If bFlag(3) Then
If Not ExportYearCountyRedressToExcel(objExcel, objRedressGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If
objExcel.Workbooks(1).SaveAs strFileName
objExcel.Quit
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
objExcel.Workbooks(1).Sheets.Add
If bFlag(0) Then
If Not ExportYearCountyPeopleToExcel(objExcel, objPeopleGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If
If bFlag(1) Then
If Not ExportYearCountyCroupToExcel(objExcel, objCroupGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If
If bFlag(2) Then
If Not ExportYearCountyeExpenseToExcel(objExcel, objExpenseGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If If bFlag(3) Then
If Not ExportYearCountyRedressToExcel(objExcel, objRedressGrid, strItem, strTitle, strName, bHeader) Then
ExportYearCountyReportToExcel = False
Set objExcel = Nothing
Exit Function
End If
End If
objExcel.Workbooks(1).SaveAs strFileName
objExcel.Quit
解决方案 »
- INSTEAD OF触发器使用的问题
- vb里怎么获取系统静止不动的时间?
- vb +ado+sql数据库编程请教?????
- MScomm接收数据部题
- 如何用VB调用帮助文件(*.chm)?
- 关于VB的问题
- vb对txt文件内容操作并纪录到数组问题~
- 一个关于考试试题库试题调入的问题!急
- shell只能打开可执行的文件,那其他文件怎样运行,例如*.reg *.jpg ,请祥细答复,谢谢!
- 自己创业(讨论)
- 关于利用表格来大批量录入数据的有关问题,请大家各抒己见!!以控件TDBGRID 8.0 为例
- 有谁用过Visual Studio Tools for the Microsoft Office System
objExcel.Workbooks(1).Close
objExcel.Quit