当前位置:首页教育技巧excel技巧excel表格制作

excel表格对象模式怎么取消

2024-07-03 15:29:15


1.在vb6.0中如何关闭excel对象?

建议修改成这样:

On Error GoTo err

Dim XlsApp As Object

Dim XlsSheet As Object

Dim XlsBook As Object

Set XlsApp = CreateObject("Excel.Application")

Set XlsBook = XlsApp.Workbooks.Open(Path)

XlsApp.DisplayAlerts = False

XlsBook.Close '上面的代码出错就不执行他了

XlsApp.Quit '同上,EXCEL可能留在进程中

Set XlsBook = Nothing

Set XlsApp = Nothing

err:

If err.Number > 0 Then

If Not (XlsBook Is Nothing) Then

XlsBook.Quit

End If

If Not (XlsApp Is Nothing) Then

XlsApp.Quit

End If

End If

不能用“<>;”比较两个对象

相关信息


电脑版

【免责声明】本站信息来自网友投稿及网络整理,内容仅供参考,如果有错误请反馈给我们及时更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任。
版权所有:学窍知识网 Copyright © 2011-2024 www.at317.com All Rights Reserved .