ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   .ONACTION macro call fails (https://www.excelbanter.com/excel-discussion-misc-queries/15615-onaction-macro-call-fails.html)

Wayne

.ONACTION macro call fails
 
I created a custom toolbar first without code and
attached macros to the buttons, and they worked fine.
however, I had problems sharing the workbook with others;
I followed some code posted here to create a toolbar in
code, I used the .onaction property to assign the buttons
to the same macros but they don't work - it says macro
doesn't exist!!

I noticed this difference - when it fails it says the
macro "filename.xls!macroname" not found. But when I use
the toolbar customize fature to assign the macro it's in
the form "Thisworkbook!macroname". Looking for help!!

Wayne

Dave Peterson

You may find it much easier to build the toolbar on the fly when the workbook
opens and destroy the toolbar when the workbook closes.

John Walkenbach's menumaker adds menu items on the fly. It's really simple to
use. You can find it:
http://j-walk.com/ss/excel/tips/tip53.htm

If you want a toolbar, here's how I do it:
http://groups.google.co.uk/groups?th...5B41%40msn.com

Wayne wrote:

I created a custom toolbar first without code and
attached macros to the buttons, and they worked fine.
however, I had problems sharing the workbook with others;
I followed some code posted here to create a toolbar in
code, I used the .onaction property to assign the buttons
to the same macros but they don't work - it says macro
doesn't exist!!

I noticed this difference - when it fails it says the
macro "filename.xls!macroname" not found. But when I use
the toolbar customize fature to assign the macro it's in
the form "Thisworkbook!macroname". Looking for help!!

Wayne


--

Dave Peterson

David McRitchie

One of the advantages of John's addin is the ability to arrange
your menus within submenus. So I think a better example for
doing it yourself should show that as well. I used to use John's
add-in until I got a better idea of what I wanted in my menus then
just created the menus manually and turned off the addin and the
overhead.

I do have a page to document what is in my toolbar menus,
and shows an example of what I have in mine.
I never did finish with the opposite, which would be to create the menus
which would have been useful for sharing menus.
Barhopper -- fixup for Restored Toolbars, and -- Listing of Menu Items
http://www.mvps.org/dmcritchie/excel/barhopper.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Dave Peterson" wrote in message ...
You may find it much easier to build the toolbar on the fly when the workbook
opens and destroy the toolbar when the workbook closes.

John Walkenbach's menumaker adds menu items on the fly. It's really simple to
use. You can find it:
http://j-walk.com/ss/excel/tips/tip53.htm

If you want a toolbar, here's how I do it:
http://groups.google.co.uk/groups?th...5B41%40msn.com

Wayne wrote:

I created a custom toolbar first without code and
attached macros to the buttons, and they worked fine.
however, I had problems sharing the workbook with others;
I followed some code posted here to create a toolbar in
code, I used the .onaction property to assign the buttons
to the same macros but they don't work - it says macro
doesn't exist!!

I noticed this difference - when it fails it says the
macro "filename.xls!macroname" not found. But when I use
the toolbar customize fature to assign the macro it's in
the form "Thisworkbook!macroname". Looking for help!!

Wayne


--

Dave Peterson





All times are GMT +1. The time now is 12:24 PM.

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