Password protection protection!

Status
Not open for further replies.

Andy Gee

New Member
Joined
Feb 26, 2002
Messages
48
I have some password protected worksheets which need to be shared with various users to enter data. Sometimes people find it ammusing to change the password! Is there a way I can stop them from changing the password?

Any help please as it takes hours to crack the password and I can't stop people doing it!
This message was edited by Andy Gee on 2002-02-27 07:08
 
I had to do the same thing. here's my code tied into a command button:

Private Sub CommandButton1_Click()
'unprotect workbook and sheets
ActiveWorkbook.Unprotect ("pw")
For i = 1 To Sheets.Count
Sheets(i).Unprotect ("pw")
Next i

'run your code here
ActiveWorkbook.RefreshAll

Label1.Caption = "Last refreshed " & Now

'reprotect everything
For i = 1 To Sheets.Count
Sheets(i).Protect Password:="pw"
Next i

ActiveWorkbook.Protect Password:="pw"

End Sub
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
This unprotects the workbook and every sheet in it.

Then it runs my desired code, which happens to be refresh all queries, then add the refresh time to a label box.

Then it reprotects the workbook and all worksheets with password = "pw"
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,601
Messages
6,120,465
Members
448,965
Latest member
grijken

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