Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
HELP! HELP! HELP!
I have a workbook with its structure locked. How to unprotect a workbook by macro? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
for worksheets without a password:
Sub UnlockSheet() Worksheets('sheetname').Unprotect End Sub or if it has password Sub UnlockSheet() Worksheet('sheetname').Unprotect password:="password" End Sub "FARAZ QURESHI" wrote: HELP! HELP! HELP! I have a workbook with its structure locked. How to unprotect a workbook by macro? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Oops - you said workBOOK, not workSHEET.
Use ActiveWorkbook.Unprotect instead of Worksheets('sheetname').Unprotect "FARAZ QURESHI" wrote: HELP! HELP! HELP! I have a workbook with its structure locked. How to unprotect a workbook by macro? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
THANX PAL!
I REALLY APPRECIATE! CAN U ALSO NOTIFY ME SOME CODE RESTRICTING INSERTION/DELETION, OR CHANGING SIZE OF, ANY COLUMN/ROW? THANX AGAIN! "JLatham" wrote: Oops - you said workBOOK, not workSHEET. Use ActiveWorkbook.Unprotect instead of Worksheets('sheetname').Unprotect "FARAZ QURESHI" wrote: HELP! HELP! HELP! I have a workbook with its structure locked. How to unprotect a workbook by macro? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This code will protect a worksheet from change:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True if you wish to add password protection to that, then: ActiveSheet.Protect Password:="password", _ DrawingObjects:=True, _ Contents:=True, Scenarios:=True To unprotect, it is either ActiveSheet.Unprotect when there is no password associated with the protection, or ActiveSheet.Unprotect Password:="password" when there is a password given. The passwords have to match. You can only protect/unprotect a single sheet at a time, but if you wish to do all sheets in a workbook at once: Sub ProtectOrUnprotect() Dim anySheet As Worksheet For Each anySheet in Worksheets '... put protect or unprotect code here using anySheet instead of ActiveSheet ' example of unprotecting: anySheet.Unprotect password:="FARAZ" Next End Sub "FARAZ QURESHI" wrote: THANX PAL! I REALLY APPRECIATE! CAN U ALSO NOTIFY ME SOME CODE RESTRICTING INSERTION/DELETION, OR CHANGING SIZE OF, ANY COLUMN/ROW? THANX AGAIN! "JLatham" wrote: Oops - you said workBOOK, not workSHEET. Use ActiveWorkbook.Unprotect instead of Worksheets('sheetname').Unprotect "FARAZ QURESHI" wrote: HELP! HELP! HELP! I have a workbook with its structure locked. How to unprotect a workbook by macro? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sign a workbook contains macro | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
How can I get a validation to run in a macro on a shared workbook? | Excel Discussion (Misc queries) | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |