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
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