One way to automatically run a macro when you open a
workbook is to use the Workbook_Open event in Microsoft Excel. Workbook_Open is
a built-in workbook event that runs its macro code each time you manually open
the workbook.
The following example uses the Workbook_Open event to
run a macro when you open the workbook.
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.