在excel表中如何设置退出后自动还原,并且不提示是否保存

在excel表中如何设置退出后自动还原,并且不提示是否保存
2025-01-07 02:57:21
推荐回答(1个)
回答1:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.Saved = True
Cancel = True
End Sub