Thread: Macro On Open
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
PCLIVE PCLIVE is offline
external usenet poster
 
Posts: 1,311
Default Macro On Open

All+F11 to enter VB editor. Double-click ThisWorkbook.

Paste the following:

Private Sub Workbook_Open()
<Your Code Here
End Sub


I believe the code will run once the password is entered.
Regards,
Paul
"
m wrote in message
...
What code do I need to run a macro when a file is opened? The sub name is
PNL. Also, this file is password protected. Will that affect anything?

Thanks

Adam Bush