Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Assigning Macro to Toolbar

I have written several macros to use in a workbook document in excel 2003 and
want to associate them with buttons on a tool bar. I have successfully done
this but when i try to distribute the workbook to another user on a different
PC the tool bars are no longer associated with the macros in the workbook. I
have attached the tool bars to the workbook and even have a small routine to
remove the toolbars when the workbook is closed.

I am new to programming in excel and I am sure this is something simple and
obvious. Thanks for the assistance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Assigning Macro to Toolbar

Edd, each time you modify the toolbar, you should delete the one that is
attached and re-attach the toolbar. Also, I like to delete attached
toolbars when the workbook is closed. This insures that the next time it is
open that the attached bar appears. Lastly, you can write a macro that
resets the onaction property of each button when the workbook is opened.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Edd" wrote in message
...
I have written several macros to use in a workbook document in excel 2003
and
want to associate them with buttons on a tool bar. I have successfully
done
this but when i try to distribute the workbook to another user on a
different
PC the tool bars are no longer associated with the macros in the workbook.
I
have attached the tool bars to the workbook and even have a small routine
to
remove the toolbars when the workbook is closed.

I am new to programming in excel and I am sure this is something simple
and
obvious. Thanks for the assistance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Assigning Macro to Toolbar

I am deleting the old tool bar when I make changes. The problem I am having
is when I move the workbook to a different account or computer (different
excel install) the macro tool bar is no longer properly associated with the
macros and it must be removed and recreated manually. I am unfamiliar with
the onaction property but I will look into it. Perhaps this could be used to
reset the path to the macro in the button?

Edd

"Bob Flanagan" wrote:

Edd, each time you modify the toolbar, you should delete the one that is
attached and re-attach the toolbar. Also, I like to delete attached
toolbars when the workbook is closed. This insures that the next time it is
open that the attached bar appears. Lastly, you can write a macro that
resets the onaction property of each button when the workbook is opened.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Edd" wrote in message
...
I have written several macros to use in a workbook document in excel 2003
and
want to associate them with buttons on a tool bar. I have successfully
done
this but when i try to distribute the workbook to another user on a
different
PC the tool bars are no longer associated with the macros in the workbook.
I
have attached the tool bars to the workbook and even have a small routine
to
remove the toolbars when the workbook is closed.

I am new to programming in excel and I am sure this is something simple
and
obvious. Thanks for the assistance.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assigning Macro to Toolbar

I find it much easier to build the toolbar when the workbook opens and delete it
when the workbook closes.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

But if you really want to continue creating the toolbar manually, you'll have to
delete the toolbar when the workbook closes (for all the users). Then the newly
attached toolbar will be used.

Jan Karel Pieterse has some notes:
http://www.jkp-ads.com/Articles/DistributeMacro04.htm

Note the addition of the code that deletes the toolbar in the
Workbook_BeforeClose event.

Edd wrote:

I am deleting the old tool bar when I make changes. The problem I am having
is when I move the workbook to a different account or computer (different
excel install) the macro tool bar is no longer properly associated with the
macros and it must be removed and recreated manually. I am unfamiliar with
the onaction property but I will look into it. Perhaps this could be used to
reset the path to the macro in the button?

Edd

"Bob Flanagan" wrote:

Edd, each time you modify the toolbar, you should delete the one that is
attached and re-attach the toolbar. Also, I like to delete attached
toolbars when the workbook is closed. This insures that the next time it is
open that the attached bar appears. Lastly, you can write a macro that
resets the onaction property of each button when the workbook is opened.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Edd" wrote in message
...
I have written several macros to use in a workbook document in excel 2003
and
want to associate them with buttons on a tool bar. I have successfully
done
this but when i try to distribute the workbook to another user on a
different
PC the tool bars are no longer associated with the macros in the workbook.
I
have attached the tool bars to the workbook and even have a small routine
to
remove the toolbars when the workbook is closed.

I am new to programming in excel and I am sure this is something simple
and
obvious. Thanks for the assistance.





--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning macro to toolbar - only works sometimes! Zak Excel Worksheet Functions 4 January 30th 08 04:47 PM
Assigning Macros to Toolbar buttons JMay Excel Discussion (Misc queries) 1 July 24th 07 07:22 PM
assigning macro to toolbar button tjb Excel Worksheet Functions 2 October 19th 05 06:36 PM
Assigning Macros to Toolbar buttons VBA Fun Excel Programming 2 May 25th 05 12:44 PM
Assigning VBA code to a Toolbar Bonnie[_5_] Excel Programming 2 November 11th 03 06:23 PM


All times are GMT +1. The time now is 10:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"