Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.dotnet.framework.interop,microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Hiding Methods in Automation Add-In

In VS 2005 and Excel 2003. I am writing an Automation Add-In in C# and don't
want to expose the Object methods (GetHashCode, GetType etc.) to end users to
put in their cell formulas. A post here
http://groups.google.com/group/micro...6a59ead000e62?

suggests marking the class as ClassInterfaceType.None and implementing a
public interface with just the desired methods but this does not work (maybe
it worked in .NET 1.1). Help?
  #2   Report Post  
Posted to microsoft.public.dotnet.framework.interop,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding Methods in Automation Add-In

Hi Matthew,

Check that the public interface is marked as
ComInterfaceType.InterfaceIsDual or at least
ComInterfaceType.InterfaceIsDispatch (with the [InterfaceType] attribute).

--
Regards,
Dmytro Lapshyn [MVP]
http://blogs.vbcity.com/DmytroL

"Matthew Wieder" wrote in message
...
In VS 2005 and Excel 2003. I am writing an Automation Add-In in C# and
don't
want to expose the Object methods (GetHashCode, GetType etc.) to end users
to
put in their cell formulas. A post he
http://groups.google.com/group/micro...6a59ead000e62?

suggests marking the class as ClassInterfaceType.None and implementing a
public interface with just the desired methods but this does not work
(maybe
it worked in .NET 1.1). Help?


  #3   Report Post  
Posted to microsoft.public.dotnet.framework.interop,microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Hiding Methods in Automation Add-In

The interface is set to dual - the functions still do not show up in the
Insert Function dialog in Excel. Does anyone have this working in .NET 2.0?

Dmytro Lapshyn [MVP] wrote:
Hi Matthew,

Check that the public interface is marked as
ComInterfaceType.InterfaceIsDual or at least
ComInterfaceType.InterfaceIsDispatch (with the [InterfaceType] attribute).

  #4   Report Post  
Posted to microsoft.public.dotnet.framework.interop,microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Hiding Methods in Automation Add-In

Solved it - Based on web examples, I had been implementing my class as:

public class myClass : Object, MyInterface, Extensibility.IDTExtensibility2

which makes the primary interface the object type and that was causing
the problems. Changed to:
public class myClass : MyInterface, Extensibility.IDTExtensibility2

and only the desired methods are showing in Excel now.

thanks.

Matthew Wieder wrote:

The interface is set to dual - the functions still do not show up in the
Insert Function dialog in Excel. Does anyone have this working in .NET
2.0?

Dmytro Lapshyn [MVP] wrote:

Hi Matthew,

Check that the public interface is marked as
ComInterfaceType.InterfaceIsDual or at least
ComInterfaceType.InterfaceIsDispatch (with the [InterfaceType]
attribute).

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Leveling Methods build Excel Worksheet Functions 3 October 13th 07 12:44 AM
Automation Classes / Methods, overview or list Ole Schjoeth Excel Discussion (Misc queries) 2 November 27th 06 08:14 PM
Std.Dev.methods NOT WORKING SixSpeedShifter Charts and Charting in Excel 1 July 20th 05 06:32 PM
Search Methods Dave Peterson[_3_] Excel Programming 0 July 11th 03 03:30 AM
Certain methods do not work Rohit Thomas Excel Programming 4 July 9th 03 06:36 PM


All times are GMT +1. The time now is 05:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"