宏 禁止系统弹出是否保存对文件的修改 对话框。vba改如何写呢? 10
1个回答
展开全部
application.displayalerts=false'禁止警告
保存代码
application.displayalerts=true‘恢复警告
写到事件时,代码如下
保存按钮
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
SaveAsUI = False
Cancel = False
Application.DisplayAlerts = True
End Sub
保存代码
application.displayalerts=true‘恢复警告
写到事件时,代码如下
保存按钮
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
SaveAsUI = False
Cancel = False
Application.DisplayAlerts = True
End Sub
追问
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
SaveAsUI = False//?什么意思
Cancel = False//?什么意思
Application.DisplayAlerts = True//为什么这里又设置为了true?
End Sub
是放到加载宏里面吗?不起作用啊。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询