How do you get rid of Excel warnings?

Nick Hodge

How do you get rid of Excel warnings?

Many times after macros have been recorded or written users want to remove them as they are no longer required, but they cannot get rid of the 'macro warning' pop-up that appears each time the workbook is open, (see below). (You should only follow these instructions if you have no further need for the macros or UserForms!) .

How do you get rid of Excel warnings?

Excel has the ability to put code in three places, (see here). If the code is in a standard module the key to stopping the dialog is to remove the entire module(s), not simply delete the code in it. To do this:

• Open the VBE (Alt+F11)

• In the project explorer look for the name of the workbook. Below this you should see a folder called 'Modules'. Right-click on any modules below this folder and select 'Remove [Name of module]...'

• Unless you specifically want to save the code contained within the module, answer 'no' to the dialog offering export of the module

• Once this is done with all modules, you can close the VBE and save the workbook.

• You may also have a folder called 'Forms'. If this is the case follow the same instructions as above on any forms contained in this folder.

• Close and re-open and all should be well

Unless...

You may also have code written behind 'objects' in the workbook providing 'event' code. (see here), or possibly UserForm(s) with controls (buttons, combo boxes, etc), that can also contain code. If this is the case, you simply need to delete the code as you cannot delete the module(s) that contains them. To do this:

• Open the VBE (Alt+F11)

• In the project explorer, locate the name of the workbook and below this you will find the objects in the workbook, (e.g. Sheet1, Sheet2, ThisWorkbook, etc).

• Right-click on each object in turn and select 'View code'

• A window will open. Any code lines in here should be highlighted and deleted.

This should be a route to eliminating 99% of areas where code may hide and trigger the macro warning.

How do you get rid of Excel warnings?
Nick Hodge

Nick Hodge has been a Microsoft MVP for Excel since 1999. His experience in Excel dates back to Excel V5.

Nick comes from near Southampton in the United Kingdom and makes his living outside of the industry, running the UK division of Burnsville, MN based Northern Tool + Equipment. His main interests in Excel cover Pivot Tables, External Data and VBA.

Nick Hodge’s Excel site on the user interface of Excel, how to control it through VBA and several Tips and Tricks.

Symptom When opening an Excel file that contains Liberty Reports or Office Connector queries or functions, a yellow notification bar may appear at the top of the worksheet with a "Security Warning".Background

The security warning is not due to your Liberty Reports or Office Connector software and does not indicate that there is a problem with the file. Microsoft Excel (like other Office applications) includes security features that are designed to help protect your computer from harmful content. As an example, Office documents (Excel, Word, Access, PowerPoint) can contain macros. If you received a file from an untrusted source, it's possible that it could contain macros that would be harmful to your computer or jeopardize your data if those macros were allowed to execute when the document is opened. By default, the security features of Microsoft Office disables untrusted macros and allows you the option to allow them to execute or not. Likewise, Microsoft Office documents can also contain links (i.e., Data Connections) to your company data. A document containing Data Connections received from an untrusted source could also be potentially harmful for similar reasons. If the query of the Data Connection were allowed to execute, damage could be done to information or sensitive information could be exposed. Again, for this reason, Data Connections within a document from an untrusted source are disabled by default and you have the option to enable them.

Solution

In the case of Excel files that contain Liberty Reports or Office Connector functionality, you may wish for the security warning prompt to be automatically disabled (because you trust the content of these files). You can control this via the the Trust Center Settings in Excel Options. Additionally, a digital signature is a way to identify that a document is from a trusted source. All files provided by Event 1 with your software include Event 1's digital signature.

The following Microsoft article describes the security features and how to control the security prompt:
https://support.office.com/en-au/article/Block-or-unblock-external-content-in-Office-documents-10204ae0-0621-411f-b0d6-575b0847a795

How do I remove a warning in Excel?

Hide error indicators in cells On the Excel menu, click Preferences. , and then clear the Enable background error checking check box.

How do I get rid of green triangles in Excel?

To stop the green triangle error from showing, you can switch off the background error checking in Excel. In the Ribbon, select File > Options > Formulas > Error Checking. Remove the tick from the “Enable background error checking option“, and then click OK.

How do I turn off macro warning in Excel?

Click the File tab > Options in Excel. Select Trust Center from the left-hand pane, and then click Trust Center Settings. Select Macro Settings from the left menu, then Disable all macros without notification and click OK.