Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a toolbar button
I've been looking at the help, and other posts here long enough. What I
want seems simple, but maybe it's not. I want to create a toolbar button. I want to insert a macro inside this button. I want this button to be there whenever I bring Excel up. Not specific to any 1 file. I've gone in the Tools/Customize are, and I've created a new Toolbar. Ok, now what? I don't see anything to create a button for the toolbar. Can anyone help? Thanks, J.O. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a toolbar button
Add this to your personal.xls workbook
'----------------------------------------------------------------- Private Sub Workbook_Open() '----------------------------------------------------------------- On Error Resum Next Application.CommandBars("Formatting").Controls("My Button") On Error Goto 0 With Application.CommandBars("Formatting").Controls.Add .BeginGroup = True .Caption = "My Button" .Style = msoButtonCaption .OnAction = "myMac ro" End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips (remove nothere from email address if mailing direct) "excelnut1954" wrote in message oups.com... I've been looking at the help, and other posts here long enough. What I want seems simple, but maybe it's not. I want to create a toolbar button. I want to insert a macro inside this button. I want this button to be there whenever I bring Excel up. Not specific to any 1 file. I've gone in the Tools/Customize are, and I've created a new Toolbar. Ok, now what? I don't see anything to create a button for the toolbar. Can anyone help? Thanks, J.O. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a toolbar button
Thanks for replying. Just where is the personal.xls workbook ?
I right clicked the icon as you suggested, but your instructions let me to open up the current file's VBA editor. I understand the concept of having this code executed each time Excel loads, but I don't understand the personal workbook thing. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a toolbar button
Personal.xls is a workbook that is automatically loaded at startup,
assuming you store it in the XLStart directory, and is hidden by default. It is a good place to store your application specific macros. To create one, do this: - menu ToolsMacroRecord New Macro... - in the Store macro in dropdown, select Personal.xls - click OK - when the Recording toolbar pops up, just click the stop button That's it, you will now have a Personal.xls, and when you go into the VBIDE, you will see a Personal.xls project that you can add code to. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "excelnut1954" wrote in message oups.com... Thanks for replying. Just where is the personal.xls workbook ? I right clicked the icon as you suggested, but your instructions let me to open up the current file's VBA editor. I understand the concept of having this code executed each time Excel loads, but I don't understand the personal workbook thing. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a toolbar button
Thanks Bob. I've seen references to Personal.xls, but didn't really
know what it was. Where would you put code there? In a standard module? ThisWorkbook? J.O. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a toolbar button
The code should be in this workbook because the event is workbook_open.
The macro that you want to be available might go in the module section. Arun. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create Toolbar Button | Excel Discussion (Misc queries) | |||
Create a toolbar button based on three steps | Excel Discussion (Misc queries) | |||
How do I create a customized toolbar button? Excell 2007 | Excel Discussion (Misc queries) | |||
create button in excel toolbar | Excel Programming | |||
How do I create a button on the toolbar that will start my form? | Excel Discussion (Misc queries) |