Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default error trapping

I have the following macro. which works fine when the user type the password
correctly.

however if the user types the password incorrectly. it takes them to the VBA
code.

Is there a way around this?
sub unprotect()
' Application.CutCopyMode = False
Sheets("update").Visible = True
Sheets("update").Select
ActiveSheet.unprotect
Sheets("update").Select

ActiveSheet.Shapes("Label1").Visible = True
ActiveSheet.Shapes("Label2").Visible = True
ActiveSheet.Shapes("Label3").Visible = True
ActiveSheet.Shapes("Label4").Visible = True
ActiveSheet.Shapes("Label5").Visible = True
ActiveSheet.Shapes("Label6").Visible = True
ActiveSheet.Shapes("Label7").Visible = True

Sheets("update").Cells.Select
Selection.EntireColumn.Hidden = False
Sheets("fields").Visible = True
end sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"