• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • 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
Ramanathan Tito Titan Nadar
Asked:
Ramanathan Tito Titan Nadar
2 Solutions
 
Wayne Taylor (webtubbs)Commented:
Unfortunately, there's no way to change the message that appears.

Wayne
0
 
FGomez02Commented:
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

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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