Password Protected Worksheet without Password

wmunsey81

New Member
Joined
Nov 30, 2017
Messages
29
I just put in VBA for 'ThisWorkbook:

Private Sub Workbook_Open()
OpenWHSE.Show
Sheet2.Protect Password:=True, UserinterfaceOnly:=False
End Sub

After running it, it protected the stuff I want. I want to do some more editing and go to unprotect, and says I didn't put in the correct password... I never put in a password in the first place. Is there a default? Help! I don't have a previous version of this and I think I locked myself out of my own excel.:mad:
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,562
Office Version
  1. 365
Platform
  1. Windows
This section is setting the password
Code:
Password:=True
so you have given it a password of TRUE (all caps)
 
Last edited:

wmunsey81

New Member
Joined
Nov 30, 2017
Messages
29
This section is setting the password
Code:
Password:=True
so you have given it a password of TRUE (all caps)

Still not letting me in. Going to Unprotect Sheet and says incorrect password

Code:
[COLOR=#000000][FONT=verdana]Private Sub Workbook_Open()[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]Sheet1.Protect Password:=True, UserinterfaceOnly:=True, AllowFiltering:=True[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]Sheet3.Protect Password:=True, UserinterfaceOnly:=True, AllowFiltering:=True[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]Sheet4.Protect Password:=True, UserinterfaceOnly:=True, AllowFiltering:=True[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]Sheet5.Protect Password:=True, UserinterfaceOnly:=True, AllowFiltering:=True[/FONT][/COLOR]


[COLOR=#000000][FONT=verdana]End Sub[/FONT][/COLOR]

Saw this in a post and did it... biggest mistake ever.
 

wmunsey81

New Member
Joined
Nov 30, 2017
Messages
29
Gives "Run-time error '1004': if done in VBA and same message if going into Review... Running 2016 Excel.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,562
Office Version
  1. 365
Platform
  1. Windows
Just seen post#5

Glad it's sorted & thanks for the feedback
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,129,573
Messages
5,637,149
Members
416,959
Latest member
Mohzein

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
Top