PDA

View Full Version : macros buttons & toolbars



northernstar
08-20-2007, 10:43 PM
hi everyone

just a quick little problem

i would like to add some custom buttons to the toolbar and i would like these to run code in every spreadsheet that i open, i can do it but i have to write the code in a spreadsheet then add the buttons, but everytime i run the code that file opens, i have wrote some code wich then closes that file

but just think it would be better if i could avoid this

i know in word i can have the macros in the Normal Project and this runs for every word file that gets open

also if i want to add the same buttons to several pcs on a network is there a quicker way of doing it without having to sit at each machine and manually do it?

many thanks

Bob Phillips
08-21-2007, 12:13 AM
You could either create an addin and attach your buttons to that workbook, or attach them to the Personal.xls, which opens when Excel starts and hides itself if you put it in the XLSTART directory.


Personal.xls is located in the XLStart directory, and is used to store macros and
things that you want to be available to all workbooks, whenever you start
Excel.

By default, it is hidden in Excel, but if you go to the VBE, you use it as you can
with any other open workbook (you don't have to unhide it).

You can create it by
- goto Tools>Macros>Record New Macro...
- Choose Personal Macro Workbook form the dropdown
- OK
- click the Stop button on the toolbar that pops-up

You now have a Personal.xls workbook. It is not visible though, it is hidden
by default (Windows>Unhide)

It is best to build the macros when the workbook (Personal.xls or addin) opens. Some suggestions can be found at John Walkenbach's menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

And Dave Peterson's toolbar:
http://www.contextures.com/xlToolbar02.html

northernstar
08-21-2007, 04:31 AM
thanks for that, i thought i had done it before in a personal.xls but just couldnt see it

thanks again i will give it a try