Macros in spreadsheet?

falcios

Active Member
Joined
Aug 30, 2006
Messages
279
Office Version
  1. 2019
Platform
  1. Windows
When I open a spreadsheet I get a message to enable or disable macros. I am sure that I don't have any macros in this spreadsheet. How can I check to be sure?

Thanks.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Once the spreadsheet is open, open up the Visual Basic Editor (Alt + F11). From there, you can check to see if there are is any code in your worksheet which would trigger the macro warning.
 
Upvote 0
Thanks for the info but I don't have any clue what to look for.
 
Upvote 0
1. When you enter the VBE, there should be a Project Explorer pane on the left-hand side. If there isn't, hit [Ctrl] + [R], or go to View | Project Explorer.

2. In the Project Explorer pane, you should see a list of all the spreadsheets and add-ins that are currently open. Select the spreadsheet that is giving you this warning from the list. If there is a "+" sign next to the spreadsheet's name, click on that to expand the sections of the spreadsheet's code. You should see folders like "Microsoft Excel Objects", "Forms", or "Modules". Expand each of these folders as well.

3. If there is a "Modules" folder, chances are there is a macro in there. If there are individual modules under this folder, double-click on them to see if they contain any code.

4. If the only folder is "Microsoft Excel Objects", double-click on each of the individual sheets as well as ThisWorkbook. If any of them contain any code, this would result in the macro warning you are seeing.
 
Upvote 0
and additional sometimes there is an empty module. If that is true then you just need to select from the Menu - File - Remove Modulex, you will be asked if you want to exprt and just answer no. Save your file and the misleading "enable macros" when opening should go away.
 
Upvote 0
Sorry like I said I am a newbie to this VBA stuff. I don't see any modulex and I clicked on each worksheet and a few of them have the code that starts with:

Private Sub Worksheet_Activate()
End Sub


There are no modules folder.

What do I search for? How do I remove macro references?

Thanks.
 
Upvote 0
where you see the
Private Sub Worksheet_Activate()
End Sub

select that and delete it

also the modulex (x meant any number) sorry for the confusion
 
Upvote 0
Thanks what I did was remove all the code and now the error message has gone away. I didn't use any code in this workbook. I hope it didn't mess something else up. It looks ok so far.
What I also keep getting though is to save the document when there were no changes. I opened and closed the file many times without making changes and same thing a message pop ups to save it.
Any ideas as to why this is happening?

Thanks so much for your help.
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,114,002
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top