ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Replace the image in a "controlbox image".... (https://www.excelbanter.com/excel-programming/434830-replace-image-controlbox-image.html)

SpeeD

Replace the image in a "controlbox image"....
 
Hi
I have in my sheet a logo that is inside a "controlbox image". The box is
already formatted.

Bur know i ahve to give my users the option of repalcing the logo, but
retein all the format of the "box" (position, back golor, etc...)

How can o do this??

Thanks a lot!!

P.S: i already have the code for asking the userr for the new logo... i just
cant make the "box" appear with the new selected image.

Peter T

Replace the image in a "controlbox image"....
 
Dim sFile As String
Dim oleObj As OLEObject

sFile = "<path\myPic.gif"
Set oleObj = ActiveSheet.OLEObjects("Image1")
oleObj.Object.Picture = LoadPicture(sFile)

If you get an error with LoadPicture highlit "function not defined", add a
reference to "OLE Automation" in Tools references.

Consider too the Autosize and PicturesizeMode properties of the image
control

Regards,
Peter T

"SpeeD" wrote in message
...
Hi
I have in my sheet a logo that is inside a "controlbox image". The box is
already formatted.

Bur know i ahve to give my users the option of repalcing the logo, but
retein all the format of the "box" (position, back golor, etc...)

How can o do this??

Thanks a lot!!

P.S: i already have the code for asking the userr for the new logo... i
just
cant make the "box" appear with the new selected image.





All times are GMT +1. The time now is 07:02 AM.

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