Microft soft Excel 2003 warning message

Posted on 2009-02-19
Last Modified: 2012-05-06
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.
Question by:TITO2009
    LVL 46

    Accepted Solution

    Unfortunately, there's no way to change the message that appears.

    LVL 5

    Assisted Solution

    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", _
    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Article by: Leon
    Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
    PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
    Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now