E
ExcelMonkey
I am getting an error in VB.Net when trying to do the following:
Dim VBComp As Microsoft.Vbe.Interop.VBComponent
For Each VBComp In xlBook.VBProject.VBComponents
DoSomething (VBComp)
Next
Sub DoSomething(ByVal X As Microsoft.Vbe.Interop.Component)
'Do something
End Sub
If fails on the line: DoSomething (VBComp)
and says:
System.InvalidCastException was unhandled
Message="Unable to cast COM object of type 'System.__ComObject' to
interface type 'Microsoft.Vbe.Interop.Component'. This operation failed
because the QueryInterface call on the COM component for the interface with
IID '{0002E163-0000-0000-C000-000000000046}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE))."
Why is this?
Thanks
EM
Dim VBComp As Microsoft.Vbe.Interop.VBComponent
For Each VBComp In xlBook.VBProject.VBComponents
DoSomething (VBComp)
Next
Sub DoSomething(ByVal X As Microsoft.Vbe.Interop.Component)
'Do something
End Sub
If fails on the line: DoSomething (VBComp)
and says:
System.InvalidCastException was unhandled
Message="Unable to cast COM object of type 'System.__ComObject' to
interface type 'Microsoft.Vbe.Interop.Component'. This operation failed
because the QueryInterface call on the COM component for the interface with
IID '{0002E163-0000-0000-C000-000000000046}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE))."
Why is this?
Thanks
EM