Compilation problem in Visual Basic

Asked By 0 points N/A Posted on -
qa-featured

I cant seem to find out what happened to my program. I keep getting this error when I compile my project:

"Invalid outside procedure"

"Only comments may appear after End Sub, End Function, or End Property"

When I tried to compile it using a separate compiler it worked. But when I compiled it with the compiler of VB Visual Studio 9 it gives me the error.

SHARE
Best Answer by jackbrown
Best Answer
Best Answer
Answered By 0 points N/A #82702

Compilation problem in Visual Basic

qa-featured

Hello,

This may be a problem because of the change in programming language change. This error says that you need to paste the code you have between event and end sub. In V.B all code must be inside begin/end of function or sub function. Double clicking on the command button of your form will take you to click event for the form. The begin and end code you want will automatically be created. Just place your code between those functions. This must be the solution for your problem.

Try it, I guess this will work fine after this.

Cheers.

Answered By 0 points N/A #82703

Compilation problem in Visual Basic

qa-featured

When using Visual Basic, you have to put your code between “begin” and “end” of your functions or sub functions.

To solve this problem, double click the command button in the form and this will lead you to the “click event” of the form, with the “begin” and “end” already present. Place all the code you need between the two and that’s all.

Related Questions