Sub Main will not be called at component startup
In Visual Basic 6.0, any code in a Sub_Main procedure for a .dll or .ocx file would be run automatically on startup. In Visual Basic .NET, Sub_Main cannot be set as a startup object; any code in the Sub_Main procedure will not be run on startup.
What to do next
- Add code to the constructor (Sub New) to call the Sub_Main procedure whenever an instance of the object is created:
Public Sub New() Main() End Sub
- Alternatively, move the code from the Sub_Main procedure to the Sub_New procedure.