Avatar of Sandeep Sood
Sandeep SoodFlag for India

asked on 

VB Project Without Any Form with Sub Main

How can i make a vb application without any form having sub main.
i tried to write the following code in general declaration section and then selected project->properties->startup object -> sub main
and tried to make the exe file. but could not compile it. it resulted in error saying "Must have startup form or sum Main()"
I am using VisualBasic 6.0 With Win-98.

Option explicit
sub main()
      :
      blah
      blah
      :
end sub

Please tell me where am i wrong and how to do this.
Thanks.
Waiting reply.
Visual Basic Classic

Avatar of undefined
Last Comment
Erick37
Avatar of vinnyd79
vinnyd79

Sub main should be in a bas module
Avatar of Mikal613
Mikal613
Flag of United States of America image

you have to go to Project properties and select the Sub Main()

Create a Module like vinny said and call It Sub Main (correct spelling)
Avatar of Tommy Kinard
Tommy Kinard
Flag of United States of America image

Hi thetechguy,

Sub Main should be in a bas module and it should be: Public Sub Main.

HTH
dragontooth

ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo