我们在Excel 2007中使用以下代码来禁用文件保存提示:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub
升级到Excel 2010后,此代码不再有效。我已经研究并尝试了以下所有代码而没有运气:
Private Sub Auto_Close()
ThisWorkbook.Saved = True
End Sub
Application.DisplayAlerts = false
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
Application.DisplayAlerts = False
End Sub
Application.EnableEvents = False
Application.DisplayAlerts = False
If WasOpened2 Then Workbooks(FilenameNoPath(FoundFiles(i))).Close False
Application.DisplayAlerts = True
Application.EnableEvents = True
赞赏任何其他想法。