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 782649
In Process

The Archive Base Latest Questions

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

I made an automation Add-In for Excel, and I made several functions (formulas). I

  • 0

I made an automation Add-In for Excel, and I made several functions (formulas).

I have a class which header looks like this (it is COM visible):

[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class Functions
{}

In a list of methods, I see:

 ToString(), Equals(), GetHashCode() and GetType() methods.

Since all methods of my class are COM visible, I should somehow hide those 4.
I succeeded with 3 of them:

ToString(), Equals(), GetHashCode()

but GetType() cannot be overriden.

Here is what I did with 3 of them:

 [ComVisible(false)]
 public override string ToString()
 {
    return base.ToString();
 }

 [ComVisible(false)]
 public override bool Equals(object obj)
 {
   return base.Equals(obj);
 }

 [ComVisible(false)]
 public override int GetHashCode()
 {
   return base.GetHashCode();
 }

This doesn’t work:

[ComVisible(false)]
public override Type GetType()
{
  return base.GetType();
}

Here is the error message in Visual Studio when compile:

..GetType()': cannot override inherited member 'object.GetType()' because it is not marked virtual, abstract, or override

So, what should I do to hide the GetType() method from COM?

  • 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-14T20:25:11+00:00Added an answer on May 14, 2026 at 8:25 pm

    You should introduce a new COM interface and inherit your class from it with ClassInterfaceType.None. This way you will only expose the methods in that interface.

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

Sidebar

Related Questions

I made a Web service in which I have a function to count some
I made a UITableViewCell and I have 20 rows in that table in which
I'm using VS2010,C# to develop an automation site (ASP.NET web app) which may have
Does Accurev have a feature like SubVersions ' svn:externals '? This works like a
I made a simple change in Designer.cs which is this.dateTimePicker.MaxDate = DateTime.Now; but whenever
We have a program made in Borland Delphi that uses Word automation to create
I have SSH running on a machine with ADSL connection. I made this script
Made this nice little loop for hiding and showing div's, works as a charm
I made a dll in c# but i need to export the functions. Is
Based on Open Firefox browser with Ruby automation script , I made a script

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.