I believe that each and every Excel user already met the case where they open a file to receive a message dialog box announcing that there is a macro in the file and asking whether or not Excel should allow its execution. Unfortunately, in 99% of the cases, there is actually no macro and you may wonder how to stop this message (whatever you answer to the dialog box, it will come again and again).
But, today, I bring you the answer, the solution, the way out.
As a matter of fact, this is happening when in the Excel file there was a macro added, then removed. So, there is no longer a macro, but Excel does not know for sure. You need to help it decide. You can completely inform it of the total absence of macro. It’s better and relatively easy.
Warning: Always make a backup copy of the Excel file before you remove any code. |
- Right click on any sheet tab and choose
View Code
, to open the Visual Basic Editor. - In the Project Explorer at the left of the screen, locate the workbook.
- Locate a
Modules
folder, and open it. (If there is noModules
folder, go directly to Step 6.) - For each module in the
Modules
folder:- Right-click on the module name.
- Choose
Remove [module_name]
([module_name]
is replaced with the actual name of the module) - Click
No
when asked if you want to export.
- Open the
Microsoft Excel Objects
folder. - In order to clean each worksheet and
ThisWorkbook
:- Double-click on the worksheet to open it.
- Press
Ctrl+A
to select all the code (even if it looks empty). - Press
Delete
.
- Locate the
Forms
folder and open it. - Delete any
UserForms
. - Locate the
Class Modules
folder, and open it. - Delete any
class
modules that it contains. - Close the Visual Basic Editor.
- Save.
Leave a Reply