MrExcel Publishing
Your One Stop for Excel Tips & Solutions

running a macro when a wrbk opens

Posted by amroo on June 29, 2001 2:57 AM

Bonjour, how do I code to run a macro when I open a wrkb by an other macro.

Posted by Dax on June 29, 2001 5:16 PM

You have to use the RunAutomacros method. For example, if your other workbook is called Book2 and is on the C drive then use this:-

sub RunMacs()
dim WB as Workbook
set WB=Workbooks.Open "C:\Book2.xls"
End Sub

Hope this helps,