locking down an excel... help needed

BPTeam

New Member
Joined
May 14, 2013
Messages
4
I am trying to protect an excel file. It contains data in hidden tabs that I do not want shared.
I know that its fairly easy to unlock an excel file that has been protected with a few lines of code.
I had an idea but needed help to know if it is possible to do it.

Is there a piece of code that can be written to state that if a password is entered correctly or a file is unlocked then a a number of formulas or sheets will be deleted?

(I know the dangers of this but is there way?)

Thanks!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I've done a couple things like that.
There is an ability to use the sheet function veryHidden. This can work out well to stop average users.

You can have it automatically have all cells hidden unless Macros are enabled to ensure that your file is locked.

Again, you can do everything you want. Either have sheets remain very hidden, where only knowing the exact name of the sheet can uncover it. However, this will only stop your average user. Some higher or advanced could by all means break in.

The best option would then be then to use a database that you'd have to login to to pull and retrieve data.

Regards,
jc.021286
 
Upvote 0
I am trying to protect an excel file. It contains data in hidden tabs that I do not want shared.
I know that its fairly easy to unlock an excel file that has been protected with a few lines of code.
I had an idea but needed help to know if it is possible to do it.

Is there a piece of code that can be written to state that if a password is entered correctly or a file is unlocked then a a number of formulas or sheets will be deleted?

(I know the dangers of this but is there way?)

Thanks!

i have password protected my code ( go to the VBE, right click on "Modules", go to the tab that says protection, click "lock project for viewing" and set your password). I also hide the sheets i need to using this

Code:
Sub Hidesheets()
    Sheets("Sheetnamehere").Visible = xlVeryHidden
    Sheets("Sheetnamehere").Visible = xlVeryHidden
    Sheets("Sheetnamehere").Visible = xlVeryHidden
    Sheets("Sheetnamehere").Visible = xlVeryHidden
    Sheets("Sheetnamehere").Visible = xlVeryHidden
    Sheets("Sheetnamehere").Visible = xlVeryHidden
    Sheets("Sheetnamehere").Visible = xlVeryHidden
    Sheets("Sheetnamehere").Visible = xlVeryHidden

End Sub

im sure there is a way to break it if someone really wanted too. but i find it works well because it hide the sheets and no one can unhide them without the password, even if they know to look in the VBE and know how to alter the sheet properties.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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