ISSUE #1043

    Class instancing was changed to public.


    In Visual Basic 6.0, instance creation was controlled by the Instancing property of a class, which set both the access level (Public, Private, Friend) of a class and the way an object could be created. In Visual Basic .NET, the Instancing property is no longer supported; you control the way that an object can be created by setting the access level of the constructor (Sub New):

    Visual Basic 6.0 Instancing Visual Basic .NET
    Private Class Access attribute: Private
    PublicNotCreatable Class Access attribute: Public. Declare the constructor Friend (Friend Sub New)
    MultiUse Class Access attribute: Public. Declare the constructor Public (Public Sub New)

    There is no direct equivalent for SingleUse, GlobalSingleUse, or GlobalMultiUse instancing in Visual Basic .NET; when the Instancing property is set to one of these values, the access level of both the class and the constructor are set to Public during upgrade.


    Check the code. The behavior may be slightly different than it was in Visual Basic 6.0, and you may need to change the access level of the class and/or the constructor.

    Download VBUC Free Trial
    Download VBUC Now

    It's time to eradicate VB6
    ROI of eradicating VB6

    8 Proven Tips for
    Planning a Successful Migration

    8 Tips for migration