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

  • Home
  • SEARCH
  • 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 589975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:28:48+00:00 2026-05-13T15:28:48+00:00

I build an assembly referencing a COM interop DLL. If I embed the COM

  • 0

I build an assembly referencing a COM interop DLL. If I embed the COM interop types by setting Embed Interop Types to True in the Reference’s properties (VS2010), at run-time an error occurs “object does not contain a definition for get_Range”. If COM interop types are not embedded then no error occurs.

Does anyone know why a particular method, Worksheet.get_Range should be ommitted or how to work around this or have any other relevant insights? I should be grateful for any help.

The interop dll contains a reference to Worksheet.get_Range(object, [object]). Using reflector on my calling assembly there is no mention of get_Range under Worksheet.

The interop assembly I am embedding is generated from Excel9.olb. I am not using PIAs as the application targets multiple Excel versions.

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-13T15:28:48+00:00Added an answer on May 13, 2026 at 3:28 pm

    I have not tried this out myself yet, but I believe that the syntax has changed when using embedded COM Interop types under C# 4.0 to a more “C# friendly” syntax.

    Therefore, instead of looking for the get_Range(object, [object]) method, you can either omit the optional parameter (instead of having to provide Type.Missing), or you can avoid calling the get accessor completely, and instead reference the property name using square brackets:

    // Using C# 3.0:
    Excel.Range range = worksheet.get_Range("A1", Type.Missing);
    
    // Using C# 4.0, omitting the optional parameter:
    Excel.Range range = worksheet.get_Range("A1");
    
    // Using C# 4.0, utilizing square-bracket indexing:
    Excel.Range range = worksheet.Range["A1"];
    

    From what I understand, though, you should still be able to call it the “old way”, where the new indexer syntax is really calling the required ‘get’ and ‘set’ accessor behind the scenes, so I don’t really know why you are having trouble. My guess is that you need to look under Worksheet.Range instead of Worksheet.get_Range within the IntelliSense listing. If this does not work for you, then it sounds like something may be wrong with your setup or installation.

    For more on this, see: Indexed Properties in C# 4.0 by Kirill Osenkov.

    Hope this helps…

    Mike

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

Sidebar

Ask A Question

Stats

  • Questions 295k
  • Answers 295k
  • 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 If you're wondering about &=, here's a quote from JLS… May 13, 2026 at 6:51 pm
  • Editorial Team
    Editorial Team added an answer The answer is maybe. If the functions names are C++… May 13, 2026 at 6:51 pm
  • Editorial Team
    Editorial Team added an answer I believe your validation should reside in your domain model.… May 13, 2026 at 6:51 pm

Related Questions

I'm trying to build an application that is strongly named. It is referencing a
I am currently working on a .net project which I am dividing into different
I have a project whereby I'm trying to create a distribution zip file, which
How does Excel VSTO Work? If I create an Excel Workbook solution in Visual
Nikhil Kothari's Script# is quite possibly one of the most amazing concepts I've seen

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.