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

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

问题描述

我在按钮下有以下代码.单击该按钮只会关闭当前的Excel工作表,而不是整个Excel应用程序.

I have following code under a button. When clicked it just closes the current Excel sheet but not the entire Excel application.

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

注意:我没有打开任何其他工作表.

Note: I don't have any other sheets open.

仍然出现以下窗口.

推荐答案

我遇到了这个问题,并通过输入Workbook_BeforeClose()解决了它:

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

ThisWorkbook.saved = true

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

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