Module Name Change 101

G

Guest

Hi, This is something really simple.

A Console Application example in a course book, where the module file name
was renamed to Welcome1, works fine when I use the original name "module1"
for the module.
In the book they advise to change this module name to "modFirstWelcome"
simply by replacing the identifier "module1" to "modFirstWelcome". Nothing
else seems to be needed. Fine, but if I do so and go to Build>Build Solution,
an error comes up stating: : “ ‘Sub Main’ was not found in Welcome1.module1 “
The section "SumMain ... to .. End Sub is still there. So it looks like the
new name is not recognized. What is wrong and how do I do this correctly?

So the following works fine:

Module module1

Sub Main()
Console.WriteLine("Welcome to Visual Basic!")
End Sub

End Module

While this does not:

Module modFirstWelcome

Sub Main()
Console.WriteLine("Welcome to Visual Basic!")
End Sub

End Module

Thanks for your advice,
 
S

Shane Thomas

In the book they advise to change this module name to "modFirstWelcome"
simply by replacing the identifier "module1" to "modFirstWelcome". Nothing
else seems to be needed. Fine, but if I do so and go to Build>Build Solution,
an error comes up stating: : " 'Sub Main' was not found in Welcome1.module1 "
The section "SumMain ... to .. End Sub is still there. So it looks like the
new name is not recognized. What is wrong and how do I do this correctly?

You may need to change Project -> Properties, then in the Common
Properties section highlight General and check your Startup Object.
Could that be it?
 

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