PC Review


Reply
Thread Tools Rate Thread

Adding a COM object from code-behind into a web form

 
 
John
Guest
Posts: n/a
 
      30th Nov 2005
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Child form code access to parent code object =?Utf-8?B?UmF5IE1pdGNoZWxs?= Microsoft C# .NET 1 1st May 2007 05:14 AM
Adding a query object in my VB code mahadevan.swamy@gmail.com Microsoft Access VBA Modules 0 18th Apr 2007 08:54 PM
Excel crashes when adding code using vbproject object? =?Utf-8?B?bWlrZWI=?= Microsoft Excel Programming 5 8th May 2006 11:57 PM
Adding Object Library to VBA Code aaron Microsoft Access VBA Modules 1 24th May 2004 10:34 PM
No icon when adding embedded OLE object with code? Philip Kime Microsoft Access Form Coding 0 7th May 2004 10:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:32 AM.