I'm receiving the following compile error when using a public class variable in a looping/iteration statement in a VBA environment:
Variable required - can't assign to this expression
For simplified illustration purposes, create the following class in an empty VBproject in some Office product.
Public lngLoop As Long
Next, insert a module and add the following routine:
Dim cThing As New Class1
For cThing.lngLoop = 1 To 5
If you compile or run the sub, you should see the error message.
I have assigned and retrieved values from such public class variables without error. What's going on here and is there any way around this?