workbook protection with password locking vba

Bill Rockenbach

Well-known Member
Joined
May 4, 2009
Messages
1,425
I use activworkbook.protect password:="MyPassword" , save and close the workbook. When I reopen it the workbook opens as if there were no macros. No messages.
I can open the vb editor but the macros are not enabled. Just loaded my 2007 excel on a new dell laptop when this problem started.

Any ideas why this is happening?

Thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
If you changed from pre-2007 to 2007 or when you saved it with the password did you by any chance do a save as and pick .xlsx ?
 
Last edited:
Upvote 0
Thanks for the thought, but the file was always saved as an .xlsm.
Actually I did not change Excel versions. I moved Excel 2007 to a new laptop. My old laptop os was Windows 10. The new one runs Windows 11

I have now discovered the problem occurs if protecting the workbook using the ribbon if I set a password.
I think it may be Windows 11 Defender that is cusing the problem and my research tells me you can't shut it off completely even if you load your own anti visus software.
 
Upvote 0
I'm afraid I haven't installed Windows 11 yet, so I don't know anything about it having any issues with Excel.
Leila Gharani has done a youtube video on Windows 11 so I gather she is not having any isssues with it, although it could also be that she hasn't tried the exact scenario that you are referring to.
I don't know if any of your issue relates to the fact the that 2007 is getting quite old now and if combining it with Windows 11 is causing any compatibility issues.
This article indicates compatibility may be an issue:
Will your Microsoft Office work on Windows 11?
Extract:-
“NOT supported on Windows 11 is Office 2013 or earlier versions of Office like Office 2010 and Office 2007.
……………
That doesn’t mean those versions of Office won’t work, just that Microsoft doesn’t recommend it and won’t help if you try.”
 
Upvote 0

Forum statistics

Threads
1,214,851
Messages
6,121,931
Members
449,056
Latest member
denissimo

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