Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to unprotect an excel sheet using VBA?

user-image
Question ajoutée par Majid Shafi Ahmad , Data Entry Operator (BS-12) , Punjab Food Authority
Date de publication: 2016/10/20
Firas Shahadi
par Firas Shahadi , Training And Development Director , Muhayal Assir National Hospital

the stright to point method is:

worksheet.unprotect "password"

 

Anand Srivastava
par Anand Srivastava , ASSISTANT MANAGER

press alt F11 a popup window will appear, insert a security module in the VBA code using insert menu,then copy paste the window and save it and execute it by pressing F5

Mark Anthony Valenzuela
par Mark Anthony Valenzuela , Food and Beverage(Waiter/Server) , TESDA(Technical Education and Skills Development Authority

press alt f11 insert a module using insert menu,then copy paste the window.and execute it by pressing f5

nasir iqbal
par nasir iqbal , Team Lead , SBTC

A string that denotes the case-sensitive password to use to unprotect the sheet or workbook. If the sheet or workbook isn't protected with a password, this argument is ignored. If you omit this argument for a sheet that's protected with a password, you'll be prompted for the password. If you omit this argument for a workbook that's protected with a password, the method fails.

Masood Ahmed
par Masood Ahmed , Training , Sungard (FIS)

Private Sub Unprotectsheet() 

 

 

'This code will protect "Sheet1" with the password test

 

    ActiveSheet.Unprotect Password:="test" 

    Sheets("Sheet1").Select 

    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _ 

    False 

    ActiveSheet.Protect Password:="test" 

 

'This below code will then unprotect "sheet1" using password "test", you only 'need this bit for your question

  Sheets("Sheet1").Select 

ActiveSheet.Unprotect Password:="test"

 

'or you can use

Sheets("sheet1").Unprotect Password:="test"

 

 

 

     

End Sub 

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?