View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
salgud salgud is offline
external usenet poster
 
Posts: 219
Default How does XL "lose" a macro that's right there?

On Wed, 3 Jun 2009 11:24:41 -0600, salgud wrote:

Working on a macro for a while. I have a tool on a toolbar assigned to that
macro. It worked just fine until this morning. When I click on the button,
I get an error, "The macro "Tribal TR Template V1.xls'!Create TR' cannot be
found". Yet the worksheet with that name and the macro with that name are
both there, right in front of me.

I've gone in and reassigned that button to that macro, which is there in
the list of macros, and I still get the same message. I created another
button on another toolbar and assigned it to this macro and still get the
same message!

Does anyone know what this could be?


I found the problem, though I haven't a clue as to how this could happen.
The macro had a compile error in it where I was modifying it. Since I
didn't know how to solve the problem of it not running from the button, I
decided to run it from the macro list until I solved this problem. I fixed
the compile error, and, voila! The macro then ran from the toolbar button!
I dont' understand this at all. Shouldn't a call to run the macro from a
toolbar button give the same result as selecting the macro to run from the
macro list? Why did executing the macro from the button give me a message
saying the macro couldn't be found, and running it from the macro list gave
me the compile error?