I have developed a custom VSTO application that manipulates data in a database through an Excel interface. The User has a limited entry field (all other cells are set to Locked=true), but can expand it through a custom form interface that they can easily spawn.
The client's common use of the product is going to be copying and pasting data into my application from other excel spreadsheets. Copying works perfectly(with validation and error handling), except in one case, when the area of the object they want to paste extends into the Locked region of the spreadsheet.
I'm already handling the Worksheet.Change event, but upon trying to paste an invalid region, the event is never even thrown. In addition, the message given my the excel client is very nondescriptive as to WHY the user can't paste, just saying that the user is trying to modify a locked cell.
What I'm looking for (and I'm stumped as to where to find it) is some way to catch the invalid copy/paste event and show a custom message to the user. Is there some event I can handle, or some way to catch when excel has errors
Thanks in advance.

Excel copy/paste
Chimme
airwalker2000
Hi Andrew
I think this is more of an Excel object model issue but am keen to know if an error is thrown that can be trapped within your code have you tried to wrapper the code in a Try/Catch block and see if an error is raised. If so this maybe then easy to handle and display a different error.
Additionally you could look to handle the paste command in a macro on your worksheet and then do a check on the current location and then raise your own error and then fire the Selection.Paste(). Simply having a set of code or macro button to replace this functionality.
Regards