ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding a Custom Toolbar to an .xla, not to Excel globally (https://www.excelbanter.com/excel-programming/297139-adding-custom-toolbar-xla-not-excel-globally.html)

RJ Lohan

Adding a Custom Toolbar to an .xla, not to Excel globally
 
Hi all,

I want to know if its possible, and how to, save a custom toolbar I have
created to my .xla addin? Currently, I have a custom toolbar created
using my own icons (hence, I want to avoid doing this in code so I don't
have to ship the icon files with the addin and PasteToFace them manually).

But when I run code to show the toolbar, it ends up being 'stuck' in
Excel, and deleting my addin doesn't remove the toolbar (which is now
useless as the macro code behind it is gone)..

I can achieve this in Word and Powerpoint, but am struggling with Excel...


Any ideas?


Cheers,
RJ

Bob Phillips[_6_]

Adding a Custom Toolbar to an .xla, not to Excel globally
 
If you put the icons on a worksheet you can paste them from there, no need
to ship separately from the add-in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"RJ Lohan" wrote in message
...
Hi all,

I want to know if its possible, and how to, save a custom toolbar I have
created to my .xla addin? Currently, I have a custom toolbar created
using my own icons (hence, I want to avoid doing this in code so I don't
have to ship the icon files with the addin and PasteToFace them manually).

But when I run code to show the toolbar, it ends up being 'stuck' in
Excel, and deleting my addin doesn't remove the toolbar (which is now
useless as the macro code behind it is gone)..

I can achieve this in Word and Powerpoint, but am struggling with Excel...


Any ideas?


Cheers,
RJ




RJ Lohan

Adding a Custom Toolbar to an .xla, not to Excel globally
 
Thanks, I'll give that a try. How do I reference the pictures from the
worksheet?

Cheers,
Ryan

Bob Phillips wrote:
If you put the icons on a worksheet you can paste them from there, no need
to ship separately from the add-in.


Norman Jones

Adding a Custom Toolbar to an .xla, not to Excel globally
 
Hi Ryan,

By index: Activesheet.Pictures(1)
by name: Activesheet.Pictures("Picture 1")

---
Regards,
Norman.

"RJ Lohan" wrote in message
...
Thanks, I'll give that a try. How do I reference the pictures from the
worksheet?

Cheers,
Ryan

Bob Phillips wrote:
If you put the icons on a worksheet you can paste them from there, no

need
to ship separately from the add-in.




Bob Phillips[_6_]

Adding a Custom Toolbar to an .xla, not to Excel globally
 
Ryan ,

As I said, I do this by putting the pictures on a hidden sheet on the
workbook that the commandbar is created from, with code somewhat like

cbTable.Shapes(shapename).CopyPicture
cbCtl.PasteFace

where cbTable is the codename of the sheet containing the picture, shapename
is the name of the shape, such as 'Picture 30', and cbCtl is an object
variable for the control being added.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"RJ Lohan" wrote in message
...
Thanks, I'll give that a try. How do I reference the pictures from the
worksheet?

Cheers,
Ryan

Bob Phillips wrote:
If you put the icons on a worksheet you can paste them from there, no

need
to ship separately from the add-in.





All times are GMT +1. The time now is 06:37 AM.

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