1
votes

When I write VBA code, I tend to cut and paste variable names or other bits of code. This results in frequent syntax check errors that result in the message box popping up. That's annoying, and I'm aware that I can turn it off via Tools > Options > Editor > uncheck Auto Syntax Check.

This doesn't seem to prevent the VBA editor from actually checking my line - it still turns red. I don't mind that behavior, because it doesn't interrupt anything. And it does let me know if I do, in fact, have some sort of problem after I'm done with the line, which is nice. Unfortunately, I'm not always smart enough to diagnose the error on my own, and the text in the message box is actually helpful. But I've turned off the message box!

Is there a way for me to display that error, short of temporarily turning the message box on?

2

2 Answers

4
votes

You can compile, with Debug>Compile, which will bring up the same message. IF there's more than one compile error you might have to deal with that one first.

1
votes

This comment is for users of Visual Basic for Excel on a Mac.

I am using Visual Basic in Excel verion 16.14.1, (the latest version as of July 2018), as part of Office 365 on an iMac Pro, running High Sierra.

Under the Tools tab of the Visual Basic editor, there are only three choices:

  1. References...
  2. Macros....
  3. VBA Project Properties......

None of these sub-menus lead to "Options", nor to anything which allows you to turn on and off "Auto Syntax Check"

Instead that option can be found in Excel ==> Preferences tab. However. checking or unchecking the box does not change the behaviour. In both cases, the text turns red on a syntax error, but in neither case does the annoying pop-up window appear.