Macro warning with no macros

D

dannycombs

I have a workbook that when I try to open it I get the warning tellin
me it contains macros and asking whether I want to Enable or Disabl
them. I put no macros, no VB scripts, nothing at all in the workboo
other than standard Excel formulas and some charts. I developed it i
Excel 2002, SP-2, but have moved it back and forth between tw
computers, the other which has Excel 97. Regardless of whether
Enable or Disable or change the security settings so as not to get th
warning, once the workbook is open even if I go t
Tools-Macro-Macros... it lists no macros.

How can I find out what's causing the Macros warning and get rid o
it?

Thanks,
Dann
 
B

bene

Double check to make sure that there aren't any buttons (with Visual
Basic programs attached).
 
K

Ken Wright

One possibility is tha you need to delete any empty modules that may have housed
macros at some point.

Hit ALT+F11 and this will open the VBE (Visual Basic Editor)
Top left you will hopefully see an explorer style pane. Within this pane you
need to search for
your workbook's name, and when you find it you may need to click on the + to
expand it. Within
that you should see the following:-

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
ThisWorkbook
Modules
Module1
Module2
etc etc (You may have just 1 of these)

If you have named your sheets then those names will appear in the brackets above
as opposed to
what you see at the moment in my note.

Right click on the modules and select remove. When prompted with a question re
exporting, just
hit no. Then hit File / Close and return to Microsoft Excel and save the file.
 
D

dannycombs

No buttons. Did check that.

In the VB Editor my workbook does appear with all the worksheet
exactly as you describe. No modules are listed though, only th
worksheets including two indepent chart worksheets that are containe
in my workbook.

There are five other VBA projects as well including
FUNCRES.XLA
HTML.XLA
LOOKUP.XLA
PROCDB.XLA
SOLVER.XLA

Solver and Lookup I imagine are there just because I chose those men
items to investigate what they were and to see if they could possibl
be related during my troubleshooting.

Thanks. Other toughts?
Dann
 
K

Ken Wright

OK, try double clicking each of the sheets you can see in the VBE as well as the
ThisWorkbook sheet, and check that you don't even have so much as a space in
there. Also, as Danny siggested, see if you have any buttons on the sheets that
contain code.
 
D

dannycombs

Bingo!

One of the worksheets windows in the VBE contained the following.

---------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

End Sub
---------------------------------

Without asking you to give me a free tutorial on VB can you tell m
what that does? Am I safe to just go ahead and delete it?
Thanks,
Dann
 
K

Ken Wright

If it's just what you've put there, not an awful lot :) A worksheet_selection
change is an event that can be trapped, and a routine run to do some action, eg,
when someone clicks on a cell and enters something, you may have a routine run
that turns it to Uppercase, or changes the font or background colour depending
on the value entered etc. You haven't actually got any code for anything to
happen, so you should be safe in deleting it. If there were any code in it, or
it was meant to do something, it would be doing it to that sheet.
 
D

dannycombs

Thanks much. That solved my problem. Not sure how it got there but
it's fixed now.
Danny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top