Displaying a picture

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

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
 
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.
 
Back
Top