-
I'm having LOTS of trouble with a very simple thing, and I can't understand why. I started a quite big project as a Standard EXE program, and now that I have almost finished it I would like to change it into a ActiveX EXE program.
No big deal, I just changed the project type property in the property window. But here comes my problem : While I had a Form as a startup object, I can't use it anymore, since VB limits me to Sub Main. So I added a Sub Main as so
Sub Main()
Form1.Show
End Sub
But VB won't even run it at startup even if it acknowledge it as the startup Sub...
Now I'm lost. Why isn't this working ?
-
Are you sure that your Sub Main() is in a Module?
___________________
-
Yes it is. and another weird thing...
When I run Sub Main through the Immediate window, the fform appear in double.
What's happening in here ??????
-
Try your Sub Main() this way:
Code:
Sub Main
Dim frm as Form1
Set frm = New Form1
frm.Show
End Sub
This doesn't show the global instance of Form1 but creates a new one. It works well in my ActiveX EXE projects.