When you programmatically open or close an Excel workbook,
you may find that you cannot use the Workbook_BeforeClose event to close another Excel workbook.
For example,
when you create and save a macro in Book2.xls that uses ThisWorkbook.Close to close Book2.xls and also uses the Workbook_BeforeClose event to close Book1.xls, the Book1.xls file is not closed as
expected when you run the macro.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.