Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programatically creating a toolbar to run macros
Hey all,
I need to come up with a way to programatically create a toolbar that contains some of my macros that will be used by various computers. Am i correct in assuming that if i manually create a toolbar that it wont show up on another computer? Under this assumption, i was trying to add some code into my autoload section that will automatically create a toolbar with three menus, about 5 items in each, name each macro (ie. open, save, exit, load, etc) and then assign each item to its respective macro. The way i begun this process was to record a macro of myself doing this. It worked to an extent and by that i mean it created the toolbar, but none of the text i entered showed up and none of the macros were assigned. I was wondering if anyone knew of an easy way to do this or should i continue trying to figure this out. Thanks, Justin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programatically creating a toolbar to run macros
If you manually create a tool bar, you can Attach that toolbar to
a workbook. This can be done only manually -- there is no programmatic way to attach a toolbar. In Excel, go to the View menu, choose Toolbars, then Customize. In that dialog, click Attach and select your toolbar in the "Custom toolbars" list and Copy it over to "Toolbars in workbook". Then, when you send the workbook, it will contain the toolbar and be accessible in the sent workbook. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com wrote in message oups.com... Hey all, I need to come up with a way to programatically create a toolbar that contains some of my macros that will be used by various computers. Am i correct in assuming that if i manually create a toolbar that it wont show up on another computer? Under this assumption, i was trying to add some code into my autoload section that will automatically create a toolbar with three menus, about 5 items in each, name each macro (ie. open, save, exit, load, etc) and then assign each item to its respective macro. The way i begun this process was to record a macro of myself doing this. It worked to an extent and by that i mean it created the toolbar, but none of the text i entered showed up and none of the macros were assigned. I was wondering if anyone knew of an easy way to do this or should i continue trying to figure this out. Thanks, Justin |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programatically creating a toolbar to run macros
alright sweet...i had done that already i just wasnt sure if that was
gonna work....i will have to wait till monday to check it on another computer. Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programatically creating a toolbar to run macros
Try this:
For add a menu Sub menu() CommandBars("Worksheet menu bar") _ ..Controls("Edit").Controls.Add(Type:=msoControlPo pup).Caption = "My menu" ..Controls("Edit")..Controls("My menu").OnAction = "My Macro" End Sub This will add a MyMenu menu in Edit menu that runs My macro macro. " wrote: alright sweet...i had done that already i just wasnt sure if that was gonna work....i will have to wait till monday to check it on another computer. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating a new excel file programatically | Excel Programming | |||
programatically creating dialog box | Excel Programming | |||
Creating a PDF file programatically from Excel | Excel Discussion (Misc queries) | |||
Programatically Creating a Hyperlink Using VB.Net ? | Excel Programming | |||
programatically accessing Macros in worksheets | Excel Programming |