tags:

views:

74

answers:

2

I have a class written in VB.Net exposed to COM via the ComClass & ComVisible attributes. The class is then made available to VBA via a TLB. In VB6 you could easily mark a member hidden in the object browser but still available with a check mark. In VB.Net the only way I found to make a member hidden the VBA object browser is to prefixing the name with an underscore.

Is there a way to hide a member without underscoring it?

A: 

The only way I can think of is to manually edit the typelib created by Tlbexp/Regasm (using tools like Oleview and Midl) and add the [hidden] IDL attribute to the method.

Mattias S
+1  A: 

You might take a look at the BrowsableAttribute in System.ComponentModel namespace. Normally this hides a property or method from intellisense but it may also work for COM.

I don't use COM myself so can't really test it.

http://msdn.microsoft.com/en-us/library/system.componentmodel.browsableattribute.aspx

Quango
+1 because this seems like it's worth a try. I don't know for sure that it will work though.
Dennis Palmer