"Can't find macro" error

I have a simple macro that executes the following:

Sub SAVE_Quit()
    ActiveWorkbook.Save
    Application.Quit
End Sub

I assigned it to a toolbar button called "Save List". Whenever I try to run 
the macro from the toolbar, I get the "can't find macro error".  But I can 
successfully run the macro from the Tools > Macro > Macros list.

The sheet is protected but I still get the error when I unprotect it.

The macro is stored in Module 1. I tried moving it to This Workbook or Sheet 
1 (in case it was stored in the wrong place) but got the same error.

What am I doing wrong?

Thanks!

-- 
JoAnn
0
JoAnn (49)
4/2/2008 4:32:00 PM
excel.newusers 15348 articles. 2 followers. Follow

11 Replies
680 Views

Similar Articles

[PageSpeed] 28

Hi JoAnn,
Try reassigning the macro to the button you are using. Do this by un-
assigning first, then reassigning. The current assignation may have an
error, or may have become corrupt.
Regards - Dave.
0
4/2/2008 6:38:10 PM
Thanks, Dave.  That seemed to fix it.
-- 
JoAnn


"Dave" wrote:

> Hi JoAnn,
> Try reassigning the macro to the button you are using. Do this by un-
> assigning first, then reassigning. The current assignation may have an
> error, or may have become corrupt.
> Regards - Dave.
> 
0
JoAnn (49)
4/2/2008 6:55:03 PM
You may have neglected to enter the path to the macro in the assignment.

i.e.   MyWorkbook.xls!MyMacro


Gord Dibben  MS Excel MVP

On Wed, 2 Apr 2008 09:32:00 -0700, JoAnn <JoAnn@discussions.microsoft.com>
wrote:

>I have a simple macro that executes the following:
>
>Sub SAVE_Quit()
>    ActiveWorkbook.Save
>    Application.Quit
>End Sub
>
>I assigned it to a toolbar button called "Save List". Whenever I try to run 
>the macro from the toolbar, I get the "can't find macro error".  But I can 
>successfully run the macro from the Tools > Macro > Macros list.
>
>The sheet is protected but I still get the error when I unprotect it.
>
>The macro is stored in Module 1. I tried moving it to This Workbook or Sheet 
>1 (in case it was stored in the wrong place) but got the same error.
>
>What am I doing wrong?
>
>Thanks!

0
Gord
4/2/2008 10:29:59 PM
I'll watch for that too ... thanks!
-- 
JoAnn


"Gord Dibben" wrote:

> You may have neglected to enter the path to the macro in the assignment.
> 
> i.e.   MyWorkbook.xls!MyMacro
> 
> 
> Gord Dibben  MS Excel MVP
> 
> On Wed, 2 Apr 2008 09:32:00 -0700, JoAnn <JoAnn@discussions.microsoft.com>
> wrote:
> 
> >I have a simple macro that executes the following:
> >
> >Sub SAVE_Quit()
> >    ActiveWorkbook.Save
> >    Application.Quit
> >End Sub
> >
> >I assigned it to a toolbar button called "Save List". Whenever I try to run 
> >the macro from the toolbar, I get the "can't find macro error".  But I can 
> >successfully run the macro from the Tools > Macro > Macros list.
> >
> >The sheet is protected but I still get the error when I unprotect it.
> >
> >The macro is stored in Module 1. I tried moving it to This Workbook or Sheet 
> >1 (in case it was stored in the wrong place) but got the same error.
> >
> >What am I doing wrong?
> >
> >Thanks!
> 
> 
0
JoAnn (49)
4/3/2008 3:14:01 PM
Well, looks like I spoke too soon.  The first suggestion did fix it so the 
macro can run from the toolbar but now I have another problem.

It doesn't save changes made to the active worksheet & I don't have a clue 
why.
I'm using Excel 2003 with an XP system.  The spreadsheet resides in a 
Sharepoint  server. 
-- 
JoAnn


"JoAnn" wrote:

> I'll watch for that too ... thanks!
> -- 
> JoAnn
> 
> 
> "Gord Dibben" wrote:
> 
> > You may have neglected to enter the path to the macro in the assignment.
> > 
> > i.e.   MyWorkbook.xls!MyMacro
> > 
> > 
> > Gord Dibben  MS Excel MVP
> > 
> > On Wed, 2 Apr 2008 09:32:00 -0700, JoAnn <JoAnn@discussions.microsoft.com>
> > wrote:
> > 
> > >I have a simple macro that executes the following:
> > >
> > >Sub SAVE_Quit()
> > >    ActiveWorkbook.Save
> > >    Application.Quit
> > >End Sub
> > >
> > >I assigned it to a toolbar button called "Save List". Whenever I try to run 
> > >the macro from the toolbar, I get the "can't find macro error".  But I can 
> > >successfully run the macro from the Tools > Macro > Macros list.
> > >
> > >The sheet is protected but I still get the error when I unprotect it.
> > >
> > >The macro is stored in Module 1. I tried moving it to This Workbook or Sheet 
> > >1 (in case it was stored in the wrong place) but got the same error.
> > >
> > >What am I doing wrong?
> > >
> > >Thanks!
> > 
> > 
0
JoAnn (49)
4/3/2008 6:58:00 PM
Hi JoAnn,
Does the macro save the changes when you run it from Tools > Macro >
Macros list?
Dave.
0
4/3/2008 7:35:20 PM
This is bizzarre...  it saves changes made to the backup whens it run in 
Sharepoint but it doesn't usually save them to the active worksheet (which I 
have done before it saves to the backup). I did get it to work for a short 
while when I ran it from the Macro > Macros but then it stopped working.

I got it to run successfully from the toolbar button just once.  But I just 
tried it again & it failed. Everytime I test I get something different.  
Right now it errors out on code that runs when the workbook is open( to 
enable Analysis Tool Pak)   but , the workbook is already open when I try to 
run the save macro so that shouldn't be happening.  I've also rebuilt the 
toolbar button several times without any change in behavior.

The more I test, the more fragile it gets. I had the best success when I 
tried it the 1st few times. But getting out/re-entering Sharepoint and/or 
Excel isn't improving the situation today.

The doc is protected, so I tried rebuilding the toolbar & button unprotected 
then protected it. Still no good.

Any thoughts?

By the way, thanks for all your advice -- you folks are awesome!
-- 
JoAnn


"Dave" wrote:

> Hi JoAnn,
> Does the macro save the changes when you run it from Tools > Macro >
> Macros list?
> Dave.
> 
0
JoAnn (49)
4/4/2008 7:46:01 PM
On Apr 3, 12:32=A0am, JoAnn <Jo...@discussions.microsoft.com> wrote:
> I have a simple macro that executes the following:
>
> Sub SAVE_Quit()
> =A0 =A0 ActiveWorkbook.Save
> =A0 =A0 Application.Quit
> End Sub
>
> I assigned it to a toolbar button called "Save List". Whenever I try to ru=
n
> the macro from the toolbar, I get the "can't find macro error". =A0But I c=
an
> successfully run the macro from the Tools > Macro > Macros list.
>
> The sheet is protected but I still get the error when I unprotect it.
>
> The macro is stored in Module 1. I tried moving it to This Workbook or She=
et
> 1 (in case it was stored in the wrong place) but got the same error.
>
> What am I doing wrong?
>
> Thanks!
>
> --
> JoAnn

Hi,

I think you should check your excel file first. And if it corrupt, you
can also try a utility called Advanced Excel Repair to repair your
Excel xls file. It works rather well for my corrupt Excel xls files.
Its web address is http://www.datanumen.com/aer/

Hope this helps.

Alan
0
fyz (26)
4/11/2008 2:00:50 PM
Okay, thanks for the tip ... I'll try that.

As a workaround, I found that executing a Save As to the original filename 
seems to work within Sharepoint even though the original code works fine from 
my PC. So, I'm doing that for now. But I'll look into the corruption issue as 
you suggested.

Thanks!

-- 
JoAnn


"Alan124" wrote:

> On Apr 3, 12:32 am, JoAnn <Jo...@discussions.microsoft.com> wrote:
> > I have a simple macro that executes the following:
> >
> > Sub SAVE_Quit()
> >     ActiveWorkbook.Save
> >     Application.Quit
> > End Sub
> >
> > I assigned it to a toolbar button called "Save List". Whenever I try to run
> > the macro from the toolbar, I get the "can't find macro error".  But I can
> > successfully run the macro from the Tools > Macro > Macros list.
> >
> > The sheet is protected but I still get the error when I unprotect it.
> >
> > The macro is stored in Module 1. I tried moving it to This Workbook or Sheet
> > 1 (in case it was stored in the wrong place) but got the same error.
> >
> > What am I doing wrong?
> >
> > Thanks!
> >
> > --
> > JoAnn
> 
> Hi,
> 
> I think you should check your excel file first. And if it corrupt, you
> can also try a utility called Advanced Excel Repair to repair your
> Excel xls file. It works rather well for my corrupt Excel xls files.
> Its web address is http://www.datanumen.com/aer/
> 
> Hope this helps.
> 
> Alan
> 
0
JoAnn (49)
4/11/2008 3:06:02 PM
JoAnn

The guy is a spammer and hpoes that people like you will think your workbook is
"corrupt" so you can buy his snakeoil.

Generally when assigning a macro to a button you preface with the workbook name.

MyWorkbook.xls!MyMacroname


Gord Dibben  MS Excel MVP

On Fri, 11 Apr 2008 08:06:02 -0700, JoAnn <JoAnn@discussions.microsoft.com>
wrote:

>Okay, thanks for the tip ... I'll try that.
>
>As a workaround, I found that executing a Save As to the original filename 
>seems to work within Sharepoint even though the original code works fine from 
>my PC. So, I'm doing that for now. But I'll look into the corruption issue as 
>you suggested.
>
>Thanks!

0
Gord
4/11/2008 10:59:04 PM
Thanks, Gord.
-- 
JoAnn


"Gord Dibben" wrote:

> JoAnn
> 
> The guy is a spammer and hpoes that people like you will think your workbook is
> "corrupt" so you can buy his snakeoil.
> 
> Generally when assigning a macro to a button you preface with the workbook name.
> 
> MyWorkbook.xls!MyMacroname
> 
> 
> Gord Dibben  MS Excel MVP
> 
> On Fri, 11 Apr 2008 08:06:02 -0700, JoAnn <JoAnn@discussions.microsoft.com>
> wrote:
> 
> >Okay, thanks for the tip ... I'll try that.
> >
> >As a workaround, I found that executing a Save As to the original filename 
> >seems to work within Sharepoint even though the original code works fine from 
> >my PC. So, I'm doing that for now. But I'll look into the corruption issue as 
> >you suggested.
> >
> >Thanks!
> 
> 
0
JoAnn (49)
4/14/2008 4:06:00 PM
Reply:

Similar Artilces: