ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   macro warning (https://www.excelbanter.com/new-users-excel/13547-macro-warning.html)

gls858

macro warning
 
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 toolsmacros 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

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.


--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"gls858" wrote in message
...
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 toolsmacros 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




gls858

Ken Wright wrote:
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

Nick Hodge

gls858

Try here

http://www.nickhodge.co.uk/tipstrick...warningremoval

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"gls858" wrote in message
...
Ken Wright wrote:
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




gls858

Nick Hodge wrote:
gls858

Try here

http://www.nickhodge.co.uk/tipstrick...warningremoval

Thanks Nick. There was an event code on each workbook. I
deleted it and the warning is gone. I know I didn't write
any code on these sheets. I wouldn't know how :-)
I assume it was something that Excel put in automagically
for some reason. Here's the VB. Any idea why it was added?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

gls858

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
HIS


"gls858" wrote in message
...
Nick Hodge wrote:
gls858

Try here

http://www.nickhodge.co.uk/tipstrick...warningremoval

Thanks Nick. There was an event code on each workbook. I
deleted it and the warning is gone. I know I didn't write
any code on these sheets. I wouldn't know how :-)
I assume it was something that Excel put in automagically
for some reason. Here's the VB. Any idea why it was added?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

gls858




Gord Dibben

gls

Debra Dalgleish has info and instructions here.........

http://www.contextures.on.ca/xlfaqMac.html#NoMacros


Gord Dibben Excel MVP

On Wed, 16 Feb 2005 13:27:41 -0600, gls858 wrote:

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 toolsmacros 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



gls858

Gord Dibben wrote:
gls

Debra Dalgleish has info and instructions here.........

http://www.contextures.on.ca/xlfaqMac.html#NoMacros


Gord Dibben Excel MVP

On Wed, 16 Feb 2005 13:27:41 -0600, gls858 wrote:


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 toolsmacros 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



Thanks Gord. Got it sorted. Looks like it must be
a fairly common problem.

gls858


gls858

Nick Hodge wrote:
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

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.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"gls858" wrote in message
...
Nick Hodge wrote:
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




gls858

Ken Wright wrote:
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

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 :-)

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"gls858" wrote in message
...
<snip



gls858

Ken Wright wrote:
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


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com