Solved

one more question

Posted on 2003-10-22
3
138 Views
Last Modified: 2010-05-03
what's mean by "Sub Main" was not found.
0
Comment
Question by:gegou
3 Comments
 
LVL 19

Accepted Solution

by:
Desp earned 125 total points
ID: 9602053
you are having problems with the start up form
from the projects menu --> Project1 Properties --> Startup object.
select a start up Form from here
and re run the project
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 9602058
In the VB IDE, open a project file.  On the menu, click on Project, then select the last item in the list to view the project properties.  (It will say Project1 Properties if the project is called Project1).

On the general tab, there is a place to tell the project where to start code execution.  By default, it is Form1, which means code will start at

Private Sub Form_Load()
    MsgBox "Started from Form_Load()"
End Sub

on Form1.  If you change it to Sub Main then you must have a MODULE with a sub called main in it.

Public Sub Main()
    MsgBox "Started from Main()"
End Sub  

Hope this helps.
0
 
LVL 4

Expert Comment

by:brother7
ID: 9602065
It means that when you tried to compile your project, it couldn't find the subroutine Main.  You should have a Main subroutine, as this is the entry point in console applications.  When this error appears in the Task List, click on it.  You will be given a chance to specify the module/Main location.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
consolidate or create a new vba code for performing tasks 5 66
MS Date Picker 64 bit 32 bit issue 12 55
Prevent user closing word document opened with VB6 6 74
MsgBox 4 61
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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

803 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