Unprotect sheet using a password in a VBA macro

  Berater 10:53 02 Oct 2003
Locked

ActiveSheet.Unprotect ("pwrd")doesn't work in Excel 97. Microsoft's workaround,

ActiveSheet.Unprotect password:="pword", Contents:=True, _
Scenarios:=False, DrawingObjects:=True, UserInterfaceOnly:=True

also doesn't work.

Microsoft states this has been resolved in Office 2000. Have legit reasons for needing to do it in 97.

Can anyone please help?

Brian

  VoG II 16:30 02 Oct 2003

This worked for me in Excel 97

ActiveSheet.Unprotect password:="pwrd"

I can't check it now (on XP) but I used it in code I develkoped using Excel 5 and Excel 97.

  Berater 16:44 02 Oct 2003

Very much appreciate your taking the trouble to help. Have found a solution: it is to add before the code to unprotect the sheet,
Sheets("Invoice").Select.

It works find. Thanks again.

BJ

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

HP Envy x2 review: Hands-on

How Sketch and InVision have revolutionised our design workflow

The best tech gifts for Christmas 2017

Les meilleurs jeux de société (2017)