Results 1 to 4 of 4

Thread: How can i create a VB tool without having a GUI front

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Posts
    23

    Smile How can i create a VB tool without having a GUI front

    How can i create a vb program without a GUI. I just want a simple .exe file which can be executed by either double-clicking or execution through DOS.
    In other words, i do not want any physical form to the program or having the need to provide setup packaging.

    cheers for your help.

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Posts
    234
    You:
    1) Create a standard EXE
    2) Delete the inital form dropped into the project
    3) Add a module with the following function:

    VB Code:
    1. Private Sub Main()
    2.   'This is the entry sub into your program
    3.   'Place your code here
    4. End sub
    4) In the Project Properties, set the Startup Object from
    form 1 to Sub main.

    And that should be it. Just remember though, the exe still needs
    the vb runtimes if you wish to distribute (even without a form)

  3. #3
    Member
    Join Date
    Nov 2002
    Location
    Michigan
    Posts
    54

    one question about this

    The only question I have with this is when you say you want to run the program and don't want a GUI do you want it to just have everything hard coded and run when you run it, or do you want to be able to pass items into it to change settings that you may set with a GUI such as a path or any item.

    If you just want it to just run when double clicking without passing information into it then you can just create a new project then remove the Form and add a module. then from that point ass a Sub Main and end Sub and place your code in there, from that point change the startup to the Sub Main in VB for that project by clicking on Project Properties under the Project Pulldown.

    Attached is a simple project that has just a messageBox Run when you run this project.
    Attached Files Attached Files

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Posts
    23

    Thumbs up

    Cheers guys. This is helpful. In answer to your question, yes i will be requiring arguments from the user. The way i plan to do this is via a configuration file where the user will provide the required arguments. The .exe will be run by Windows Task scheduler every night. When the .exe is executed the code inside will read in this file to retrieve the values and perform its necessary tasks.
    Thanks for the code, i will look into it.

    By the way, any of you guys know how activeX exe works. Would this be an alternative solution as well, or it is something totally different?

    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width