Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul
Sub SHEETPROTECT() ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _ Contents:=True, Scenarios:=True End Sub Sub SHEETUNPROTECT() ActiveSheet.Unprotect Password:="justme" End Sub Combine the two as in........ Sub Do_Stuff() ActiveSheet.Unprotect Password:="justme" 'your code here ActiveSheet.Protect Password:="justme" End Sub Gord Dibben Excel MVP On Tue, 22 Jun 2004 09:42:19 -0500, PaulSin wrote: I've got a spreadsheet with some cells that need to be locked on it. However, I need to then unlock the sheet when a macro is run over it which hides some columns. Is there a way to unlock a spreadsheet that has password protection? When I use the command ".unlock" it comes up with a prompt for the password. Can I somehow put that into the code? Basically I need to unlock the sheet to run a macro, but I can't seem to totally automate it for other users as currently I get a prompt for the password. Any ideas? Thanks for your help, Paul --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to unlock a sheet without password | Excel Discussion (Misc queries) | |||
How to unlock an Excel sheet | Excel Discussion (Misc queries) | |||
Prevent User to unlock Sheet Tabs | Excel Worksheet Functions | |||
how do i password protect an .xls file? how do i unlock it for automation. e.g. want to unlock and access a .xls from another .xls macro. | Excel Worksheet Functions | |||
Sheet Protection Unlock | Excel Worksheet Functions |