Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code that unprotects a sheet and a workbook.
On Error GoTo errorHandler ActiveSheet.Unprotect 'Unprotects the sheet: Menu ActiveWorkbook.Unprotect (123) 'Unprotects the workbook Sheets("InternalMenu").Visible = True 'Unhides sheet: Internal Menu Sheets("JobSheet").Visible = True Exit Sub On Error GoTo 0 errorHandler: MsgBox "The Password you have supplied is incorrect. Please verify that you have the correct capitilistation." The trouble is that when you are prompted for the password to unprotect the sheet, if you press cancel, the code still runs. How can I manage the cancel button on the Password prompt box to actually exit the sub when cancel is pressed. I have tried if unprotect = vbCancel then exit sub, and varaiations of this, but to no envail. Can anyone help? Thanks, Pinda |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
protect cells in excel, but also allow a search in those cells? | Excel Worksheet Functions | |||
How do I protect cells or a range of cells in excel spreadsheet? | Excel Worksheet Functions | |||
Protect cells but not Group function | Excel Worksheet Functions | |||
How do I protect cells against only the "Delete" function? | Excel Discussion (Misc queries) | |||
Lock and protect cells without protect the sheet | Excel Programming |