Hiding Excel Workbook with a password

webtouch

New Member
Joined
Dec 2, 2005
Messages
8
How can I hide a workbook with a password to prevent others from viewing the macros on it? Others should be able to run the macros thereon
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Good morning webtouch

Sounds to me like you need to make your workbook into an add-in. This means the file will open without a workbook being visible (Excel won't allow you to hide ALL worksheets in an xls file) and the macros can be called from within that. The code can also be protected so it can't be opened without a password. As always, be aware that this password can be removed - it will keep out casual users but an experienced user will be able to remove the password without breaking a sweat.

If you want to turn your workbook into an add-in, there is an excellent tutorial here :

http://www.jkp-ads.com/Articles/DistributeMacro00.htm

HTH

DominicB
 

webtouch

New Member
Joined
Dec 2, 2005
Messages
8
Thank you DominicB.

But I have one workbook which I cannot remember what I did to make it ask for password wherever I want to hide or unhide it.

Has anybody experienced this?
 

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Hi webtouch

Are you sure that you didn't use Tools > Protection > Protect workbook and check the "Structure" box. If you invoke this you cannot hide or unhide any sheets unless you unprotect it first.

You can apply a password to this protection - the same warning on security applies as above, but doubly so.

HTH

DominicB
 

webtouch

New Member
Joined
Dec 2, 2005
Messages
8
Once again thanks you DominicB

The password required by this action does not even require a confirmation!!!

All I can remember, I clicked on Wndow/hide intending to unhide a file and a password window popped up. As I was protecting other sheets with a password, I typed the same password and ZOOOOOm the workbook was unhidden! I clicked on hide and password prompt came up and repeatd my password and it was hidden.
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
You can hide your modules from view using the VBA Project Properties. Open the VBE(ALT+F11) and locate your workbook(project) in the project explorer on the left. If the project explorer is not open, use CTRL+R to open it. Right click on your project and select VBAProject Properties. On the protection tab, check "Lock project from viewing". Assign a password.

This will prevent MOST users from viewing the code. If that is not enough, then the Add-in approach might be best.

lenze
 

Watch MrExcel Video

Forum statistics

Threads
1,118,676
Messages
5,573,603
Members
412,538
Latest member
mrjack
Top