Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50061

attribute VB_usermemid=0

$
0
0
I have picked up this trick about working in VBA to make a default member in a class but never get it to work.

What I have done each time I export the class module and removing it from my project I add the attribute line just after the member name then I import it back into my project. I compile and save. Nothing shows that my member is in fact the default. I check this with object browser to show my class. The member is never marked with a distinct blue dot. Then I export the file again I open the cls file the line that I added previously is gone! It is as if the VBA IDE eat that line totally.

I know there are lots of people who have done this before. I am using VBA v6.5 from excel2007. Maybe they don't accept this Attribute lne any longer?

Here is an example

sub mymethod()
Attribute mymethod.VB_UserMemId=0

the attribute line will disappear when I export the module 2nd time.

Viewing all articles
Browse latest Browse all 50061

Trending Articles