J
John
Hi all,
How do I add a COM object to a web form?
I notice there's a primary interop assembly for Office web components and
what I'm trying to do here is to create a PivotTable object (which is fine)
but then I want to add it to a web page (e.g.
Page.Controls.Add(COMPivotTable)).
I receive the following error message but don't understand what I need to do
to correct this:
"Unable to cast COM object of type
'Microsoft.Office.Interop.Owc11.PivotTableClass' to class type
'System.Web.UI.Control'. Instances of types that represent COM components
cannot be cast to types that do not represent COM components; however they
can be cast to interfaces as long as the underlying COM component supports
QueryInterface calls for the IID of the interface."
Any ideas?
Regards
John.
How do I add a COM object to a web form?
I notice there's a primary interop assembly for Office web components and
what I'm trying to do here is to create a PivotTable object (which is fine)
but then I want to add it to a web page (e.g.
Page.Controls.Add(COMPivotTable)).
I receive the following error message but don't understand what I need to do
to correct this:
"Unable to cast COM object of type
'Microsoft.Office.Interop.Owc11.PivotTableClass' to class type
'System.Web.UI.Control'. Instances of types that represent COM components
cannot be cast to types that do not represent COM components; however they
can be cast to interfaces as long as the underlying COM component supports
QueryInterface calls for the IID of the interface."
Any ideas?
Regards
John.