How do I use Startup Object = Sub Main

D

Dave

Title is pretty self explanatory. I don't want my application to start with
a form loading, I want some code to be run when the application starts.
Where do I put this code when I select "Sub Main" as my "Startup Object?"

Thank you kindly,

-Dave
 
H

Herfried K. Wagner [MVP]

Dave said:
Title is pretty self explanatory. I don't want my application to start
with a form loading, I want some code to be run when the application
starts. Where do I put this code when I select "Sub Main" as my "Startup
Object?"

You can put the code into a module:

\\\
Public Module Program
Public Sub Main()
...
End Sub
End Module
///

Alternatively, you can add a shared 'Sub Main' to a class.
 
P

pmclinn

After adding the module don't forget to
goto

Project ->Properties -> and change the startup object to Sub Main.
-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top