Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to password protect a spreadsheet / sheets but need to be able to
unprotect them to manipulate them via a macro. Is this possible? The password option does not appear to be available in the protect method. Cheers |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the UserInterfaceOnly flag of the Protect method. This
prevents the user from modifying the sheet, but allows VBA to do anything. This property is not saved with the workbook, so you should protect the sheet(s) in the Workbook_Open event. E.g., Private Sub Workbook_Open() Worksheets("Sheet1").Protect Password:="abc", userinterfaceonly:=True End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Eithne R" wrote in message ... I want to password protect a spreadsheet / sheets but need to be able to unprotect them to manipulate them via a macro. Is this possible? The password option does not appear to be available in the protect method. Cheers |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes it is available
ActiveSheet.Protect Password:="Ron" ActiveSheet.Unprotect Password:="Ron" -- Regards Ron de Bruin http://www.rondebruin.nl "Eithne R" wrote in message ... I want to password protect a spreadsheet / sheets but need to be able to unprotect them to manipulate them via a macro. Is this possible? The password option does not appear to be available in the protect method. Cheers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password protecting sheets in a workbook | Excel Worksheet Functions | |||
Password Protecting Sheets in Excel So Others Can't See Certain Sh | Excel Worksheet Functions | |||
Password Protecting | Excel Discussion (Misc queries) | |||
Protecting buttons with VB code rather than protecting sheets/books? | Excel Programming | |||
Protecting Multiple sheets with prompt for password to unprotect | Excel Programming |