增加一个文件关闭时的事件,放在ThisworkbookPrivate Sub Workbook_BeforeClose(Cancel As Boolean) Application.CommandBars("Data").Controls.ResetEnd Sub