none
Differences between private and public class constructors in VBA RRS feed

  • Question

  • As the title: What is the

    Differences between private and public class constructors in VBA.

    Private Sub Class_Initialize()

    End Sub
    Public Sub Class_Initialize()

    End Sub

    Tuesday, October 30, 2012 8:41 PM

Answers

  • If you set a reference in project-B to project-A (give it a unique project name), from B you can call a routine in A to instanciate the class and pass it to B. That is, if the Class is PublicNonCreatable.

    In B you can declare the public Class in A as something like
    Dim C as projectA_name.Class1

    Peter Thornton

    • Marked as answer by Young_2 Wednesday, October 31, 2012 8:43 PM
    Wednesday, October 31, 2012 1:19 PM
    Moderator

All replies