I have an own class (ClassFoo) with a simple property (pName), and I could not set it, because I always get error ...
Class Modules - ClassFoo
---
Public pName as String
Public Property Let Name(Value as String)
pName = Value
End Property
----
Somewhere else in the ModuleX
...
Dim Foo as ClassFoo
Foo.Name = "foo" <- throws error
Foo.pName = "foo" <- throws error
or
With Foo
.pName = "foo" <- throws error
End With
I changed the class 'Instancing' from 'Private' to 'PublicNotCreatable' (back and forth) But I still have the same error ...
Thanks for the replies in advance.
Cs
You need to create an instance & assign it to Foo so;
Dim Foo as ClassFoo
Set Foo = new ClassFoo
You need to instantiate it I believe try
Dim foo as new ClassFoo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With