where is the workbook_open event handler???

  • Thread starter Thread starter Steff_DK
  • Start date Start date
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
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top