我想创建一个提示,提醒用户在关闭它之前导出文件。我的代码如下所示:插入MessageBox与选项取消关闭文件的问题
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Response As Long
Response = MsgBox("If changes have been made to this file without running the Monthly Claim Program, you MUST run the 'Export to Mastersheet' program. If you have not yet exported the file, please press NO, and do so. Otherwise, press YES to close this file", vbYesNo)
If Response = vbNo Then
Cancel = True
Else
End If
Call Remove_Macros_Menu
End Sub
但是,无论我选择True还是False取消功能,文件都会关闭。任何想法,为什么这是?
适用于我,Remove_Macros_Menu做什么?它关闭了WB吗?如果是这样你想在其他块 – 2011-05-17 16:52:05