3

In VBA I would like to call a Property Let() from within my class constructor rather than just setting the variable in the constructor. Is there anyway to do this?

1 Answer 1

11

Unless I've misunderstood your question, you're looking for the Me keyword.

Option Explicit

Dim l_ As Long

Private Sub Class_Initialize()
    Me.l = 5
End Sub

Public Property Let l(newl As Long)
    l_ = newl
End Property
Sign up to request clarification or add additional context in comments.

1 Comment

You understood it perfectly, that's exactly what I was looking for. I knew it had to be something simple. Thank you very much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.