ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pictures in file (https://www.excelbanter.com/excel-programming/283419-pictures-file.html)

Christof DB

Pictures in file
 
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

Nicke[_3_]

Pictures in file
 
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)

Thanks in advance
Christof
.


Christof DB

Pictures in file
 
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


All times are GMT +1. The time now is 08:59 PM.

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