Excel Workbook Password Lost

GRKira
NewLounger
Posts: 12
Joined: 05 Oct 2018, 07:47

Excel Workbook Password Lost

Post by GRKira »

Hi Gurus
Hope you are all keeping safe and well.
One of my spreadsheets has the Workbook structure password protected however the password doesn't work - I have tried various things like Caps Lok on/off first letter caps and rest not and vice versa. Can not figure out how or why. I need to unprotect the workbook. All the worksheets are unprotected as they responded to the password.
Is there any way of unprotecting the workbook without the password please?
Thanks
Pam

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Excel Workbook Password Lost

Post by HansV »

Open the workbook.
Press Alt+F11 to activate the Visual Basic Editor.
Press Ctrl+G to activate the Immediate window.
Type or copy/paste the following line

Code: Select all

ActiveWorkbook.Sheets.Copy
Press Enter.
Switch back to Excel.
You now have an unprotected copy of the workbook.
Don't forget to save it.
Best wishes,
Hans

GRKira
NewLounger
Posts: 12
Joined: 05 Oct 2018, 07:47

Re: Excel Workbook Password Lost

Post by GRKira »

Thanks Hans - did that but the Protect Workbook is still highlighted. See attached screen shots - did I do the VB correct?
Thanks
Pam
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Excel Workbook Password Lost

Post by HansV »

You have to click inside the line ActiveWorkbook.Sheets.Copy before pressing Enter. Excel should then create a copy of the workbook.
Best wishes,
Hans

adeel1
3StarLounger
Posts: 264
Joined: 04 Oct 2017, 15:47

Re: Excel Workbook Password Lost

Post by adeel1 »

Hi sir

that the super revealing
just for learning point of view.

i created one dummy WBk its totally blank, i did follow the steps but i have error
Capture.PNG
Adeel
You do not have the required permissions to view the files attached to this post.

GRKira
NewLounger
Posts: 12
Joined: 05 Oct 2018, 07:47

Re: Excel Workbook Password Lost

Post by GRKira »

You are absolutely marvelous Hans - worked that time, thank you so much :)

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Excel Workbook Password Lost

Post by HansV »

Hi Adeel, that workbook has been protected for opening.

Pam mentioned a workbook protected for structure. I assumed that she meant that Protect Workbook had been clicked on the Review tab of the ribbon.

S0488.png

Such a workbook can be opened normally, but you cannot insert, delete or move sheets.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

adeel1
3StarLounger
Posts: 264
Joined: 04 Oct 2017, 15:47

Re: Excel Workbook Password Lost

Post by adeel1 »

Ahh, thnx for knowledge and still it is good for learn and great idea/technique.

Adeel