title: How to hide GetType() method from COM?
body: <p>I made an automation Add-In for Excel, and I made several functions (formulas).</p>
  
  <p>I have a class which header looks like this (it is COM visible): </p>
  
  <pre><code>[ClassInterface(ClassInterfaceType.AutoDual)]
  [ComVisible(true)]
  public class Functions
  {}
  </code></pre>
  
  <p>In a list of methods, I see:</p>
  
  <pre><code> ToString(), Equals(), GetHashCode() and GetType() methods.
  </code></pre>
  
  <p>Since all methods of my class are COM visible, I should somehow hide those 4.
  I succeeded with 3 of them:</p>
  
  <pre><code>ToString(), Equals(), GetHashCode()
  </code></pre>
  
  <p>but GetType() cannot be overriden.</p>
  
  <p>Here is what I did with 3 of them:</p>
  
  <pre><code> [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();
   }
  </code></pre>
  
  <p>This doesn't work:</p>
  
  <pre><code>[ComVisible(false)]
  public override Type GetType()
  {
    return base.GetType();
  }
  </code></pre>
  
  <p>Here is the error message in Visual Studio when compile:</p>
  
  <pre><code>..GetType()': cannot override inherited member 'object.GetType()' because it is not marked virtual, abstract, or override
  </code></pre>
  
  <p>So, what should I do to hide the GetType() method from COM?</p>