Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the "compile error expected end of statement" from showing in vba

Tags:

excel

vba

Frequently when entering code I will type half of a line, for example the opening part of an if statement, but rather than type the second half I will want to copy and paste, both for convenience and to minimize the chance of a typing error. However if I move the focus away from a half completed statement I get the very annoying "compile error, expected end of statement" pop up which I must acknowledge. This is becoming very tedious when it comes up so often.

Is there any way to tell excel not to show this error message?

like image 697
Ed the Ted Avatar asked Feb 04 '14 13:02

Ed the Ted


People also ask

How do I fix compile error Expected end of statement?

To correct this error Check to see if two different statements have inadvertently been put on the same line. Insert a line terminator after the element that completes the statement.

How do I disable VBA error messages?

Do the following in your VBA editor window (entitled "Microsoft Visual Basic for Applications"): Click the menu "Tools" and then "Options". In the Options' "Editor" tab, uncheck the "Auto Syntax Check" box. (See screenshot, below.)

How do I fix a compile error in VBA?

I have resolved same error by following these 4 steps : Open Excel file which is having issue, press Alt + F11 go into its Visual Basic Editor. From the Tools menu select References ( Note, if references option is disabled in tools menu try closing and reopening file and enable Macro before proceeding next steps)

How do you stop a runtime error in VBA?

Exit the error handler and resume the macro at the line that caused the error. Your macro must automatically correct the error condition or prompt the user to correct it before resuming; otherwise, the error will occur again. Resume the macro at the line following the one that caused the error.


1 Answers

Annoying isn't it? Click Tools -> Options -> Editor Tab and uncheck Auto syntax check

like image 134
Alex K. Avatar answered Oct 02 '22 09:10

Alex K.