How run code without an event in VB?

Posted on 2006-04-26
Last Modified: 2010-04-07


I have some code I need to run in VB.  The code does not require an event - is there a way for me to run it without having to create an event (e.g. a button called "Run the darn code")?
I just want to debug the code without having to create any controls on a form...
Question by:SAbboushi
    LVL 28

    Expert Comment

    You can put the code in a module under Sub Main() and then right click on the project in the project explorer window and select properties. Then set the Startup object to Sub Main()

    LVL 4

    Accepted Solution

    or in a form load event ...

    Author Comment

    Thanks for the help folks-

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now