Disabling / customizing error messages

S

sixhobbits

Hi guys

I'm trying to customise / disable messages for two specific error messages in a specific work sheet

First Error: (on running macro
Run-time error '91'
Object variable or with block variable not se

(I would like to customise a new message in a standard message box here.

Second Error: (On attempting to edit cells in a protected sheet
The cell or chart that you are trying to change is protected and therefore read-only
To modify a protected cell or chart, first remove protection using the Unprotect Sheet command (Review tab, Changes group). You may be prompted for a password

(I would like to have this message disabled)

Thanks for your help

Sixhobbit

Is it possible to replace these instances with standard message boxes containing a customized message
 
B

Bob Phillips

To do this you have to set an error handler

On Error Goto ErrHandler

and in the error handler manage it

ErrHandler:
If Err.Number = 91 Then

'some message

'and somne code to manage it
 
S

sixhobbits

Great. Thanks

Anyone who can help on the disable 'workbook protected' message

Sixhobbits
 
G

Gord Dibben

Might be you should not allow selecting locked cells when protecting the
sheet.


Gord Dibben MS Excel MVP
 
S

sixhobbits

Unfortunately, I am using cell selection to navigate around the sheet, so the cells must be able to be selected

Thanks anyway though

sixhobbits
 
G

Gord Dibben

So select only unlocked cells.

Why bother selecting locked cells if you can't edit them?


Gord
 
S

sixhobbits

Thanks, Gord; but as I mentioned, the locked cells have to be selected in order to navigate around the page

Also, double clicking on a cell which can't be selected results in the same 'this sheet is protected' message

Anyone who knows how to actually disable this specific message

Sixhobbits
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top