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开发者_如何学Python to prefixing the name with an underscore.
Is there a way to hide a member without underscoring it?
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
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.
精彩评论