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

R

RJ Lohan

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
 
B

Bob Phillips

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)
 
R

RJ Lohan

Thanks, I'll give that a try. How do I reference the pictures from the
worksheet?

Cheers,
Ryan
 
N

Norman Jones

Hi Ryan,

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

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top