Type Mismatch between Worksheets in Excel
Posted on 2011-05-09
I have a custom addin, written in VBA for EXCEL, that contains a custom worksheet with a additional macros, and properties. The worksheet is named 'ReportSheet' in the Addin I want a macro that will copy this worksheet to my activeworkbook and allow access to the custom macros... I'm using code like this below:
Dim myReport As PTSREPORTS.ReportSheet
Set myReport = ActiveSheet
This function breaks with Run time error:13 "type mismatch". Using watches in the VBA editor, I can see that the type of ActiveSheet is "Object/ReportSheet", whereas the type of myReport is just "ReportSheet". Is there a way to disable the runtime check and accept the set statement, or to cast the objects to each other?