ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Displaying a picture (https://www.excelbanter.com/excel-programming/304262-displaying-picture.html)

todd

Displaying a picture
 
I have a cell that contains a file path to a bitmap. I
would like to display this bitmap on initialization of the
userform that I have my picture object on. This bitmap
will change constantly so I can't just do it in the
properties. Is there a way of doing this?

Thanks

Tom Ogilvy

Displaying a picture
 
Assume the cell contains a fully qualified filename:

Private Sub Userform_Initialize()
Dim sStr as String
sStr = Worksheets("Sheet1").Range("B9").Value
if dir(sStr) < "" then
Image1.Picture = LoadPicture( sStr)
End if
End Sub

Note that the event name is Userform_Initialize, regardless of the name of
the userform.

--
Regards,
Tom Ogilvy


"Todd" wrote in message
...
I have a cell that contains a file path to a bitmap. I
would like to display this bitmap on initialization of the
userform that I have my picture object on. This bitmap
will change constantly so I can't just do it in the
properties. Is there a way of doing this?

Thanks





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

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