我们看如下代码:Private sh As WorksheetPrivate Sub Workbook_BeforeClose(Cancel As Boolean) '第21讲 如何做到如果禁用VBA将无法继续工作Sheets('空白').Visible = TrueFor Each sh In ThisWorkbook.SheetsIf sh.Name <> '空白' Thensh.Visible = xlSheetVeryHiddenEnd IfNextActiveWorkbook.SaveEnd SubPrivate Sub Workbook_Open() '第21讲 如何做到如果禁用VBA将无法继续工作For Each sh In ThisWorkbook.SheetsIf sh.Name <> '空白' Thensh.Visible = xlSheetVisibleEnd IfNextSheets('空白').Visible = xlSheetVeryHiddenEnd Sub代码截图