macro warning

G

gls858

I have a workbook that consists of 15 worksheets. One for each
month and then a summary page for the year plus a couple of
worksheets containing charts. Every time I open it I'm prompted
that the workbook contains macros. I haven't created any macros.
I go to tools>macros and bring up the window no macros are shown.
Anybody have any ideas why this is happening? Not really a show
stopper but rather irritating.

gls858
 
K

Ken Wright

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

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.
 
G

gls858

Ken said:
One possibility is that you need to delete any empty modules that may have
housed macros.

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.
Ken,
thanks for the reply. I did in fact have an empty module. I deleted it
and saved the file. I still get the warning. Any other ideas?

gls858
 
N

Nick Hodge

Nothing is put there by MS. It requires the steps you took and then
dropping down the top left dropdown and selecting the 'object' (Worksheet,
etc). This then puts the default event code template in ready to enter your
code. That's what you have. On it's own that code does nothing. (Except
fire the security warning!)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
G

gls858

Nick said:
Nothing is put there by MS. It requires the steps you took and then
dropping down the top left dropdown and selecting the 'object' (Worksheet,
etc). This then puts the default event code template in ready to enter your
code. That's what you have. On it's own that code does nothing. (Except
fire the security warning!)
Can't imagine who would have done it. My end users wouldn't
have a clue. The weird thing is that it was on every sheet.
No matter, got it fixed now.

Thanks,

gls858
 
K

Ken Wright

If it was on every sheet then chances are that during the design stage
somebody was looking at the original sheet in the VBE before all the other
sheets were copied from that one. Just clicking on the dropdown arrow in
the VBE would generate that code, albeit by itself it does absolutely
nothing. Copying the sheet would then also copy the code etc etc.
 
G

gls858

Ken said:
If it was on every sheet then chances are that during the design stage
somebody was looking at the original sheet in the VBE before all the other
sheets were copied from that one. Just clicking on the dropdown arrow in
the VBE would generate that code, albeit by itself it does absolutely
nothing. Copying the sheet would then also copy the code etc etc.
Thanks Ken. I built the workbook in 2000 and we simply copy it
over each year to a new workbook and clear the data. It's
possible that I was poking around in the VBE. Not sure WHY
I would have been doing it because I don't know VB at all.
But then, that's never stopped me before :)

gls858
 
K

Ken Wright

If you've never had the message before then my theory's out the window, but
if it's always been there then my money's on my theory :)
 
G

gls858

Ken said:
If you've never had the message before then my theory's out the window, but
if it's always been there then my money's on my theory :)
My guess is it's always been there. I rarely use this workbook.
My end users have a bad habit of not telling me when something isn't
working exactly as expected. They just click yes or no and go their
merry little way. I always tell them I can't fix it if I don't know it's
broke.

thanks again for the help,
gls858
 

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