Automatically execute a macro when Excel file is opened


Posted by NM on December 08, 2000 5:08 AM

Is there a way to automatically execute a macro when excel file is opened?

MyTest.xls has macros, Initialize(), DoCalculation(), Close(). When I open MyTest.xls file, it should automatically execute Initialize() macro.

How can this be done?

Thanks in advance,
-NM

Posted by Celia on December 08, 2000 5:57 AM


Change the name from Initialise to Auto_Open

Celia



Posted by Lokman Mat Lazim on December 08, 2000 10:00 AM

Its pretty easy

this is the code :

Private Subworkbook_open
Initialize
End Sub

hth

Change the name from Initialise to Auto_Open