Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Creating a new excel file programatically Chimanrao Excel Programming 4 September 23rd 05 07:13 AM
programatically creating dialog box [email protected] Excel Programming 1 March 20th 05 10:51 PM
Creating a PDF file programatically from Excel Chaplain Doug Excel Discussion (Misc queries) 0 December 16th 04 08:49 PM
Programatically Creating a Hyperlink Using VB.Net ? eBob.com Excel Programming 1 December 4th 04 03:42 AM
programatically accessing Macros in worksheets Patrick[_8_] Excel Programming 1 April 15th 04 08:41 PM


All times are GMT +1. The time now is 05:38 PM.

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

About Us

"It's about Microsoft Excel"