Can I lock a worksheet so user cant see its vb coding

ateebali

Board Regular
Joined
Dec 13, 2018
Messages
108
Dear Sir
I have a excel sheet which password protected.


Though there are many macros in the file with vb coding.


When user click the different buttons link with different coding, it run first to unlock sheet, run macro then lock the sheet.


Now issue is every user can press ALT+F11 and can see the password of the sheet in VB modules.


Is there a way to restrict user that they cant go to VB modules or is there a way to hide the password in coding?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
In the VBa page select the menu "Tools" option then select "VBaProject Properties..." . In the window that opens select the "Protection" tab. When its open check the "lock project for viewing" and below enter a password.
 
Upvote 0
.
Please be reminded that the security of Excel is very, very poor. There are many examples on the internet how to by pass
the security which "hides" the VBA code.
 
Upvote 0
I have a macro that ask for the password to open a file. That way the password is not risked and adapts to changes to the password without having to update the VBA.
In my case the macro crates many new files with the same password as the original file.
 
Upvote 0
.
I'm not certain I understand your point.

If I do understand correctly, you have created a macro that requires the user enter the correct password to simply open the workbook. Without the correct
password, the user never gets to see the worksheet/s ? Even that can be bypassed with instructions on the internet, very easily.
 
Upvote 0

Forum statistics

Threads
1,213,514
Messages
6,114,078
Members
448,547
Latest member
arndtea

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