ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Static Macro in Spreadsheet (https://www.excelbanter.com/excel-programming/308593-static-macro-spreadsheet.html)

Felix[_5_]

Static Macro in Spreadsheet
 
Hi group,

I guess I haven't found the right resource and google-keywords right now,
so I try my best here.

I programmed a macro into a spreadsheet, assozicated it with a button and
created a custom buttom-image for that button. What I don't know is how to
integrate the code, button (which is on it's own toolbar) and image into
the spreadsheet so that other ppl, if they open this specific spreadsheet
have them too in the same way as I do.

Thx for any piece of advice
-fe

Frank Stone

Static Macro in Spreadsheet
 
hi,
you said toolbar so i am assuming that this is a custom
menu item from the macro command group. so...
right click the custom tool bar. click customize at the
bottom of the pop up list. click your custom icon. on the
customize dialog box click modify selection assing Macro.
I may be wrong but i think custom menu are machine
spicific. this is why i put command buttons that run
macros on the sheet so all my users will have them.

-----Original Message-----
Hi group,

I guess I haven't found the right resource and google-

keywords right now,
so I try my best here.

I programmed a macro into a spreadsheet, assozicated it

with a button and
created a custom buttom-image for that button. What I

don't know is how to
integrate the code, button (which is on it's own toolbar)

and image into
the spreadsheet so that other ppl, if they open this

specific spreadsheet
have them too in the same way as I do.

Thx for any piece of advice
-fe
.


Tim Coddington

Static Macro in Spreadsheet
 
1) Be certain your drawing toolbar is visible ...
View\Toolbars\Drawing
2) Insert some kind of autoshape; rectangle is typical for a button, but
you could use a circle or anything else, I suppose.
3) Right click on the new autoshape and assign the macro.

I'm thinking, since the autoshape goes with the workbook, the macro will
too.

"Felix" wrote in message
...
Hi group,

I guess I haven't found the right resource and google-keywords right now,
so I try my best here.

I programmed a macro into a spreadsheet, assozicated it with a button and
created a custom buttom-image for that button. What I don't know is how to
integrate the code, button (which is on it's own toolbar) and image into
the spreadsheet so that other ppl, if they open this specific spreadsheet
have them too in the same way as I do.

Thx for any piece of advice
-fe




felix

Static Macro in Spreadsheet
 
Hi Group,

thanks for the replies. I maybe didn't explain my problem pretty good,
but thanks anyway! ^^

I do know how to assign the macro to a button, my problem is that the
button is only local (?) and I'd like to distribute the macro to some of
my collegues and don't want to create the toolbar/button at their
workstations too. If they open the spreadsheet the toolbar/button should
be already there and if possible only for that workbook and not for any
other spreadsheet.

cheers
-fe

"Tim Coddington" wrote in
:

I'm thinking, since the autoshape goes with the workbook, the macro
will too.


The macro does, but the toolbar/button doesn't :-/

Tom Ogilvy

Static Macro in Spreadsheet
 
The best way to do this is to create your custom menus with a macro in the
Workbook_Open event and delete them in the Workbook_BeforeClose event. This
way you are sure you have full control over the menus and that they are
pointing to the right code when they execute.

An alternate way is to use the Attach command in the the Tools=Customize
dialog in the Toolbars tab. This way, when your file is opened, if the
toolbar does not exist, it is created from the toolbar attached to the file.
It is still a good idea to remove the toolbar when you close the workbook by
using the Workbook_BeforeClose event.

Here is an article which talks about attaching toolbars:

http://www.microsoft.com/exceldev/articles/toolbatt.htm

Here is an article about creating commandbars with code:
http://msdn.microsoft.com/library/techart/ofcmdbar.htm

Here is another article or two you might find useful:
http://msdn.microsoft.com/library/ba...n_addins97.htm
http://msdn.microsoft.com/library/of...exceladdin.htm
http://www.microsoft.com/exceldev/tips/addins.htm
These are about distributing applications

--
Regards,
Tom Ogilvy

"felix" wrote in message
...
Hi Group,

thanks for the replies. I maybe didn't explain my problem pretty good,
but thanks anyway! ^^

I do know how to assign the macro to a button, my problem is that the
button is only local (?) and I'd like to distribute the macro to some of
my collegues and don't want to create the toolbar/button at their
workstations too. If they open the spreadsheet the toolbar/button should
be already there and if possible only for that workbook and not for any
other spreadsheet.

cheers
-fe

"Tim Coddington" wrote in
:

I'm thinking, since the autoshape goes with the workbook, the macro
will too.


The macro does, but the toolbar/button doesn't :-/




felix

Static Macro in Spreadsheet
 
Great, that's exactly what I'm looking for. Thank you very much :)


"Tom Ogilvy" wrote in
:

The best way to do this is to create your custom menus with a macro in
the Workbook_Open event and delete them in the Workbook_BeforeClose
event. This way you are sure you have full control over the menus and
that they are pointing to the right code when they execute.

An alternate way is to use the Attach command in the the
Tools=Customize dialog in the Toolbars tab. This way, when your
file is opened, if the toolbar does not exist, it is created from the
toolbar attached to the file. It is still a good idea to remove the
toolbar when you close the workbook by using the Workbook_BeforeClose
event.

Here is an article which talks about attaching toolbars:

http://www.microsoft.com/exceldev/articles/toolbatt.htm

Here is an article about creating commandbars with code:
http://msdn.microsoft.com/library/techart/ofcmdbar.htm

Here is another article or two you might find useful:
http://msdn.microsoft.com/library/ba...n_addins97.htm
http://msdn.microsoft.com/library/of...reatingexcelad
din.htm http://www.microsoft.com/exceldev/tips/addins.htm
These are about distributing applications




All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com