我在excel.ComAddin.Item(“ r12.abc”)。object上遇到问题,该问题返回对象,其类型为Cognos.office.Connect,然后在Connect类上调用函数返回WrapperObject。我需要从Wrapperobject中获取方法以进行进一步调用。
Dim obj As Microsoft.Office.Core.COMAddIn = _excel.COMAddIns.Item("r12.abc")
If (obj.Connect) AndAlso obj.Object IsNot Nothing Then
o = CType(obj.Object, Cognos.Office.BootStrap.Connect) -- Error says COM obj cant be convert to class but if i doesnt convert as class i cant read o.Wrapperobject()
o.Wrapperobject()
End If