FaCoffee
FaCoffee

Reputation: 7909

How to disable Formula Error Correction Prompt?

I am not very familiar with VBA and I have to perform a task that involves opening a number of Excel files. These are full of broken links and I don't have the time to change things. As I open each file, 5(!) message windows pop up, one after another, and to get rid of them I have to hit "OK".

One of the "OK" windows is this: enter image description here

Wanting to avoid this, I have

  1. Opened an empty Excel spreadsheet;
  2. Hit Alt+F11 to launch the VBA editor;
  3. Pasted the following code

    Sub Appl_Display_Alert_Ex2()
       Application.DisplayAlerts = False
       ActiveWorkbook.Close
    End Sub
    
  4. And then hit F5 to run it.

However, while I thought that this applied to Excel as a whole, I assume it only applies to the single file, because I then went to open one of my broken files and the 5 windows popped up anyway.

Question: is there a way for me to avoid the "OK" message windows for all Excel files, whatever they are?

Upvotes: 1

Views: 1297

Answers (1)

Samuel Hulla
Samuel Hulla

Reputation: 7089

I would strongly advise against doing this, as it's not a good practice - generally it's better to simply fix the formulas/tables to avoid this error - but if you absolutely insist on doing this.

You can go to File -> Options -> Formulas -> Error Checking / Error Checking Rules and disable whatever checks necessary to avoid this prompt.

enter image description here

What I'd however recommend you to do instead, is to closely follow this article here and fix it the proper way instead!

Upvotes: 4

Related Questions