Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Accessing the underlying OLE data

I am creating an AddIn for Excel 2002+ using C# 2005.
I can access the OLEObject within Excel using interop but I dont know
how can I access the data inside it ("Native"). I tried using
OLEObject::Copy() and then using OleOpenClipboard() to get
IDataObject
pointer and it worked. But I don;t want to use clipboard during this
operation

this is what I did :

///////////////////////////////////////////////////////////////////////////*///////////////////////////////////////////////////////////////////////////*/////////////
Guid guidDataObject = new Guid("0000010E-0000-0000-
C000-000000000046"); // Guid for IDataObject
IntPtr pUnknown = Marshal.GetIUnknownForObject(oleObject);

IntPtr pDataObject = IntPtr.Zero;
int hr = Marshal.QueryInterface(pUnknown, ref guidDataObject, out
pDataObject);
///////////////////////////////////////////////////////////////////////////*///////////////////////////////////////////////////////////////////////////*/////////////

But the HRESULT says "Specified cast is not valid"
I also tried using OleRun() before QueryInterface(...), but it didnt
work.


thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying pivot cell underlying data watkincm Excel Discussion (Misc queries) 18 August 22nd 06 03:26 AM
How do I copy subtotaled data without the underlying details? DBergesen Excel Worksheet Functions 1 December 15th 05 06:25 PM
Why doesn't my chart update when underlying data changes? Marc Charts and Charting in Excel 3 November 19th 05 05:31 PM
how do i copy subtotals without the underlying data? Homer Excel Discussion (Misc queries) 4 April 26th 05 04:22 PM
update underlying data john q public[_5_] Excel Programming 0 October 28th 04 02:36 PM


All times are GMT +1. The time now is 09:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"