Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Displaying pivot cell underlying data | Excel Discussion (Misc queries) | |||
How do I copy subtotaled data without the underlying details? | Excel Worksheet Functions | |||
Why doesn't my chart update when underlying data changes? | Charts and Charting in Excel | |||
how do i copy subtotals without the underlying data? | Excel Discussion (Misc queries) | |||
update underlying data | Excel Programming |