Pictures in file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Gents

upon opening a file I included some code to add a commandbar to excel. At this stage, I load an external image to display as button.

Question: how can I include those (10) small bitmaps inside the workbook so I don't need external files (looks messy

(I've tried to include them as pictures and then load from there, but can get it to work

Thanks in advanc
Christof
 
Hi,

This will put a picture from a sheet to a commandbar
control. You'll have to create a sheet named "Pictures"
and a image called "Pic_1" to run this example.

Dim CBCtrl As CommandBarControl

Set CBCtrl = CBPopUp.CommandBar.Controls.Add
(msoControlButton)

ThisWorkbook.Worksheets("Pictures").Activate

ThisWorkbook.Worksheets("Pictures").Shapes
("Pic_1").Select

Selection.Copy
CBCtrl.PasteFace

Hope this helped.

/Nicke
-----Original Message-----
Gents,

upon opening a file I included some code to add a
commandbar to excel. At this stage, I load an external
image to display as button.
Question: how can I include those (10) small bitmaps
inside the workbook so I don't need external files (looks
messy)
(I've tried to include them as pictures and then load
from there, but can get it to work)
 
Yes, Thanks it helped

However
1. is there a similar way to set the mask of a button
2. why is this PasteFace method hidden and undocumpented? Is there a way to find out more about hidden functions
3. In terms of compatibility, is it wise to use hidden functions

Christof
 

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

Back
Top