When editing Microsoft Office VBA, how can I disable the "Compile Error" pop-up messages?

When you edit a macro or a Microsoft Office VBA function, you often move the cursor from a line that you have not finished yet. For example, to copy what you want to paste into this line. But if this partial line is not syntactically valid, the VBA editor interrupts your work, causing a compilation error message that should be rejected.

Is there a way to disable the message box? I find it annoying ...

(This happens with Excel Visual Basic for Applications, Outlook VBA, Word VBA, etc.)

+80
editor vba
Jul 19 '12 at 12:29
source share
2 answers

Do the following in the VBA editor window (called "Microsoft Visual Basic for Applications"):

Select the Tools menu and then Options .

On the Editor tab, select Automatic Syntax Check . (See screenshot below.)

This change does not allow the editor to stop compiling in the background and mark syntax errors in red (or other formatting is indicated on the Options tab).

MS Office programs use a common VBA editor, so if you change a parameter while editing VBA for Excel, you change it to Outlook, Word, etc.

MS VBA editor's Tools Options dialog box

+107
Jul 19 '12 at 13:29
source share

In VBE, select Tools - Options - Editor and uncheck Auto Syntax Check. It will turn the bad code into red, but will not give you a popup.

+19
Jul 19 '12 at 13:30
source share



All Articles