excel vba - Error 91 in VBA using simple classes -
dim newcis cis dim newstring string private sub commandbutton1_click() newstring = "lol" newcis.contactname = newstring userform1.label1.caption = newcis.contactname end sub
i run error 91 on line 6. here cis class:
private strcontactname string property let contactname(name string) set strcontactname = name end property property contactname() string set contactname = strcontactname end property
i've tried using set function instead of property let, leads error 91. there crucial knowledge object oriented programming in vba i'm missing?
you forgot create new instance of class:
private sub commandbutton1_click() newstring = "lol" set newcis = new cis newcis.contactname = newstring userform1.label1.caption = newcis.contactname end sub
Comments
Post a Comment