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

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)
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,223,958
Messages
6,175,635
Members
452,661
Latest member
Nonhle

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