VBA Application.Quit命令不关闭整个Excel应用程序 [英] VBA Application.Quit command not closing the entire Excel Application

查看:1102
本文介绍了VBA Application.Quit命令不关闭整个Excel应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下面的代码。当我点击它,它只是关闭当前excel表,但不关闭整个excel应用程序。

  Application.DisplayAlerts = False 
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit

注意:我没有打开任何其他表单



关闭后通过上述VBA代码,以下窗口仍然出现。

解决方案

我有这个问题,我通过放入 Workbook_BeforeClose()

  ThisWorkbook.saved = true 


I have following code under a botton. When i clicked it, it just closes the current excel sheet but not closing entire excel application.

Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit

Note: I don't have any other sheets open

following window still appears after closing through above VBA Code .

解决方案

I had this issue and I resolved it by putting in the Workbook_BeforeClose():

ThisWorkbook.saved = true

这篇关于VBA Application.Quit命令不关闭整个Excel应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆