where is the workbook_open event handler???

S

Steff_DK

How can I insert code in the workbook_open event handler?

I want to display a form when the workbook opens.

Also:

How do I protect my code with a password?

Cheers

Steff
 
C

Chip Pearson

Steff,


You put the Workbook_Open code in the ThisWorkbook code module.
It won't work if placed anywhere else. You can protect the
VBProject with a password by going to the Tools menu in VBA,
selecting VBA Project Properties, and then the Protection tab.
There, check "Lock Project For Viewing", and enter a password.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
L

Leo Heuser

Hi Steff

Enter the VBA-editor with <Alt><F11>.
Locate your project in the project window
(upper left of screen) (View > Project explorer)
Doubleclick ThisWorkbook.
In the righthand window choose "Workbook"
from the left roll-down menu. Choose the
different events from the right roll-down menu.

To protect your code choose Tools > VBA project properties
and the tab "Protection".
Return to the workbook with <Alt><F11>
Save your workbook, close it and open again to activate
the protection.
 
Top