• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Microft soft Excel 2003 warning message

I had protected my worksheet, if any want try to amendment the cell, the warning message by default from excel appears. How to disable that and create my own warning message instead.
0
Rama Tito
Asked:
Rama Tito
2 Solutions
 
Wayne Taylor (webtubbs)Commented:
Unfortunately, there's no way to change the message that appears.

Wayne
0
 
Fernando GomezDBACommented:
You can use the "Open" event of the "Workbook" Object.

Try pressing ALT + F11, and look in the left part of the screen the object called "ThisWorkbook" and make double clic on it, after that in the first combo box on the screen, look for the work "WorkBook" and in the second combo box select "Open". Then write this code. The only thing bad is that the password will be visible, but you can protect your VBA Project.

After this, make a double clic in the seet you want to protect and use the "BeforeDoubleClick", "BeforeRightClick" event and use the code following the "Open" event.

Hope this helps.
Private Sub Workbook_Open()
Application.DisplayAlerts = False
Sheets("Sheet You Want To Protect").Protect Password:="Secret", _
UserInterFaceOnly:=True
End Sub
 
 
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "This Sheet Is Protected!" & vbcrlf & "You can contact XXX", vbCritical, "Edit Disabled"
End Sub
 
 
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "This Sheet Is Protected!" & vbcrlf & "You can contact XXX", vbCritical, "Edit Disabled"
End Sub

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now