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.
 

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