Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing Exception of oleobject operation

Status
Not open for further replies.

joechan

Programmer
Jun 29, 2005
4
HK
Hi all, I need help on how to trap exceptions within the same procedure/function and display customed message when dealing with oleobject operation.

Code (within button click() event)
oleobject ole1

ole1 = create oleobject
:
:
ole1.application.activeworkbook.worksheets.Add
ole1.application.activeworkbook.worksheets("Form").Cells.Copy
ole1.application.activesheet.Paste
:
:

Currently, when the opened worksheet does not contain the "Form" sheet, systemerror event will be triggered and cannot return the calling point that caused error.

Thanks
Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top