Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 155895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:14:10+00:00 2026-05-11T10:14:10+00:00

How can I find out the properties and methods of COM objects returned from

  • 0

How can I find out the properties and methods of COM objects returned from some .NET functions, which do not appear to be documented?

In the particular example I’m looking at, I’m inserting a picture into Excel using a function like:

Set NewPic = ActiveSheet.Pictures.Insert(FileName) 

(See the SO post on this here.)

However, the MSDN documentation for this function only says that Worksheet.Pictures returns an Object, and when I put a watch on the variable during debugging its type is System.__ComObject. Can I find out what other properties and functions might be available for that class (for example, I want to modify the alternative text for the picture)? How would the person who found out about the Insert function even have known about it?

The MSDN doc also tends to say of such functions that they are ‘not intended to be used directly from your code’, but let’s ignore that for now…

Thanks!


Edit: Well, I managed to answer my specific question at least. Instead of using Worksheet.Pictures.Insert, you can use Worksheet.Shapes.AddPicture to return a proper (documented) Excel.Shape class:

pic = range.Worksheet.Shapes.AddPicture(tmpFile, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, range.Left, range.Top, image.Width, image.Height) pic.AlternativeText = 'Help!' 

Would still be interested in any resources for undocumented functions though.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:14:11+00:00Added an answer on May 11, 2026 at 10:14 am

    One way to find these things out is to use the OleView tool (which you can download from Microsoft here). This tool allows you to view COM Type Libraries. The Type Library (assuming the vendor of the COM component provided type library information) contains information about the interfaces and the methods and properties of the COM classes exposed by an application or library.

    For example, on my machine, I can view the Type Library for C:\Program Files\Microsoft Office\Office12\EXCEL.EXE and see what COM objects are exposed by Excel, and their properties and methods. OleView displays information in IDL (Interface Description Language), which is more or less a C function prototype with extra attributes tacked on).

    This is the IDL declaration I got using OleView for the __Worksheet.Pictures property:

        [id(0x00000303), hidden, helpcontext(0x00010303)]     HRESULT Pictures(                     [in, optional] VARIANT Index,                      [in, lcid] long lcid,                      [out, retval] IDispatch** RHS); 

    Note the hidden attribute on the declaration. This means it won’t be displayed by most IDE’s (and is a good hint to not rely on this method always existing – Microsoft could remove it in a later version of Excel).

    Now what about the Pictures class? Here is the full IDL:

    [   uuid(000208A7-0000-0000-C000-000000000046),   helpcontext(0x00020067),   hidden ] dispinterface Pictures {     properties:     methods:         [id(0x60000000), restricted]         void QueryInterface(                         [in] GUID* riid,                          [out] void** ppvObj);         [id(0x60000001), restricted]         unsigned long AddRef();         [id(0x60000002), restricted]         unsigned long Release();         [id(0x60010000), restricted]         void GetTypeInfoCount([out] unsigned int* pctinfo);         [id(0x60010001), restricted]         void GetTypeInfo(                         [in] unsigned int itinfo,                          [in] unsigned long lcid,                          [out] void** pptinfo);         [id(0x60010002), restricted]         void GetIDsOfNames(                         [in] GUID* riid,                          [in] char** rgszNames,                          [in] unsigned int cNames,                          [in] unsigned long lcid,                          [out] long* rgdispid);         [id(0x60010003), restricted]         void Invoke(                         [in] long dispidMember,                          [in] GUID* riid,                          [in] unsigned long lcid,                          [in] unsigned short wFlags,                          [in] DISPPARAMS* pdispparams,                          [out] VARIANT* pvarResult,                          [out] EXCEPINFO* pexcepinfo,                          [out] unsigned int* puArgErr);         [id(0x00000094), propget, helpcontext(0x00010094)]         Application* Application();         [id(0x00000095), propget, helpcontext(0x00010095)]         XlCreator Creator();         [id(0x00000096), propget, helpcontext(0x00010096)]         IDispatch* Parent();         [id(0x00010003), restricted, hidden]         void _Dummy3();         [id(0x0000025a), helpcontext(0x0001025a)]         VARIANT BringToFront();         [id(0x00000227), helpcontext(0x00010227)]         VARIANT Copy();         [id(0x000000d5), helpcontext(0x000100d5)]         VARIANT CopyPicture(                         [in, optional, defaultvalue(2)] XlPictureAppearance Appearance,                          [in, optional, defaultvalue(-4147)] XlCopyPictureFormat Format);         [id(0x00000235), helpcontext(0x00010235)]         VARIANT Cut();         [id(0x00000075), helpcontext(0x00010075)]         VARIANT Delete();         [id(0x0000040f), helpcontext(0x0001040f)]         IDispatch* Duplicate();         [id(0x00000258), propget, helpcontext(0x00010258)]         VARIANT_BOOL Enabled();         [id(0x00000258), propput, helpcontext(0x00010258)]         void Enabled([in] VARIANT_BOOL rhs);         [id(0x0000007b), propget, helpcontext(0x0001007b)]         double Height();         [id(0x0000007b), propput, helpcontext(0x0001007b)]         void Height([in] double rhs);         [id(0x0001000c), restricted, hidden]         void _Dummy12();         [id(0x0000007f), propget, helpcontext(0x0001007f)]         double Left();         [id(0x0000007f), propput, helpcontext(0x0001007f)]         void Left([in] double rhs);         [id(0x0000010d), propget, helpcontext(0x0001010d)]         VARIANT_BOOL Locked();         [id(0x0000010d), propput, helpcontext(0x0001010d)]         void Locked([in] VARIANT_BOOL rhs);         [id(0x0001000f), restricted, hidden]         void _Dummy15();         [id(0x00000254), propget, hidden, helpcontext(0x00010254)]         BSTR OnAction();         [id(0x00000254), propput, hidden, helpcontext(0x00010254)]         void OnAction([in] BSTR rhs);         [id(0x00000269), propget, helpcontext(0x00010269)]         VARIANT Placement();         [id(0x00000269), propput, helpcontext(0x00010269)]         void Placement([in] VARIANT rhs);         [id(0x0000026a), propget, helpcontext(0x0001026a)]         VARIANT_BOOL PrintObject();         [id(0x0000026a), propput, helpcontext(0x0001026a)]         void PrintObject([in] VARIANT_BOOL rhs);         [id(0x000000eb), helpcontext(0x000100eb)]         VARIANT Select([in, optional] VARIANT Replace);         [id(0x0000025d), helpcontext(0x0001025d)]         VARIANT SendToBack();         [id(0x0000007e), propget, helpcontext(0x0001007e)]         double Top();         [id(0x0000007e), propput, helpcontext(0x0001007e)]         void Top([in] double rhs);         [id(0x00010016), restricted, hidden]         void _Dummy22();         [id(0x0000022e), propget, helpcontext(0x0001022e)]         VARIANT_BOOL Visible();         [id(0x0000022e), propput, helpcontext(0x0001022e)]         void Visible([in] VARIANT_BOOL rhs);         [id(0x0000007a), propget, helpcontext(0x0001007a)]         double Width();         [id(0x0000007a), propput, helpcontext(0x0001007a)]         void Width([in] double rhs);         [id(0x0000026e), propget, helpcontext(0x0001026e)]         long ZOrder();         [id(0x000005f8), propget, helpcontext(0x000105f8)]         ShapeRange* ShapeRange();         [id(0x00000080), propget, helpcontext(0x00010080)]         Border* Border();         [id(0x00000081), propget, helpcontext(0x00010081)]         Interior* Interior();         [id(0x00000067), propget, helpcontext(0x00010067)]         VARIANT_BOOL Shadow();         [id(0x00000067), propput, helpcontext(0x00010067)]         void Shadow([in] VARIANT_BOOL rhs);         [id(0x00000105), propget, helpcontext(0x00010105)]         BSTR Formula();         [id(0x00000105), propput, helpcontext(0x00010105)]         void Formula([in] BSTR rhs);         [id(0x000000b5), helpcontext(0x000100b5)]         Picture* Add(                         [in] double Left,                          [in] double Top,                          [in] double Width,                          [in] double Height);         [id(0x00000076), propget, helpcontext(0x00010076)]         long Count();         [id(0x0000002e), helpcontext(0x0001002e)]         GroupObject* Group();         [id(0x000000fc), helpcontext(0x000100fc)]         Picture* Insert(                         [in] BSTR Filename,                          [in, optional] VARIANT Converter);         [id(0x000000aa), helpcontext(0x000100aa)]         IDispatch* Item([in] VARIANT Index);         [id(0xfffffffc), helpcontext(0x0000fffc)]         IUnknown* _NewEnum();         [id(0x000000d3), helpcontext(0x000100d3)]         Picture* Paste([in, optional] VARIANT Link); 

    From this, you can surmise that the Pictures interface has a Cut and Delete method, as well as an Item property, among others. However, note that this interface is also marked hidden, which (again) is a good indication that you shouldn’t really be using it (yes, I know you were ignoring that warning, but I second Mitch Wheat’s comment that it’s generally a bad idea to use hidden classes, because they are usually meant for the application’s own internal use and are subject to change without notice.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 190k
  • Answers 190k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to first call setlocale(LC_ALL, ""); nl_langinfo always gives… May 12, 2026 at 5:53 pm
  • Editorial Team
    Editorial Team added an answer Instead of using SQL mapping, you can achieve this using… May 12, 2026 at 5:53 pm
  • Editorial Team
    Editorial Team added an answer You don't need data adapter or data set for this… May 12, 2026 at 5:53 pm

Related Questions

I would like to find a way to see what happens while my XAML
I am having a couple of issues deciding how best to describe a certain
There are lots of Fluent implementations out there now that work with Lambdas to
I'm writing a utility for myself, partly as an exercise in learning C# Reflection

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.