1

I'm using worksheet protection IWorksheet.ProtectContents. If i try to change something there is message: "Locked cells cannot be modified when protection is enabled". So is there a way to change text and title of this message or though hide it?

1 Answers1

2

You can handle the WorkbookView.ShowError(...) event, which would give you the chance to prevent certain error messages from popping up or provide your own custom message. Example:

private void workbookView_ShowError(object sender, SpreadsheetGear.Windows.Controls.ShowErrorEventArgs e)
{
    if (e.Message == "Locked cells cannot be modified when protection is enabled.")
    {
        MessageBox.Show("My custom message");
        e.Handled = true;
    }
}
Tim Andersen
  • 3,014
  • 1
  • 15
  • 11