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
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top