ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   where is the workbook_open event handler??? (https://www.excelbanter.com/excel-programming/296216-where-workbook_open-event-handler.html)

Steff_DK[_10_]

where is the workbook_open event handler???
 
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


---
Message posted from http://www.ExcelForum.com/


Chip Pearson

where is the workbook_open event handler???
 
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



"Steff_DK " wrote in
message ...
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


---
Message posted from http://www.ExcelForum.com/




Leo Heuser[_3_]

where is the workbook_open event handler???
 
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.

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Steff_DK " skrev i en meddelelse
...
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


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com