Loading an image from Worksheet to an Image Object in a Userform (MS Excel 2007)

AdiQ0502

New Member
Joined
Mar 14, 2014
Messages
1
Greetings!

I am currently trying to design a userform that would show different images (images are already in place on a worksheet) depending on which text box is active. The code is roughly like this:

Private Sub Txt_Le_Enter()
' << SHOW A PICTURE FOR Le PARAMETER >>
Txt_Le.ForeColor = vbBlack
End Sub

Private Sub Txt_W_Enter()
' << SHOW A PICTURE FOR W PARAMETER >>
Txt_W.ForeColor = vbBlack
End Sub

Private Sub Txt_D_Enter()
I' << SHOW A PICTURE FOR D PARAMETER >>
Txt_D.ForeColor = vbBlack
End Sub

I can't seem to find a way to load a picture to the image box and I keep getting an Object required error. I also can't make use of file referencing because what I am trying to do requires that only one file is to handled, and needing to reference files would not be very favorable, thus I need the pictures to be immediately available on the Worksheets. I believe this has been a problem of many users before but most of what I see online are referring to MS 2003. Perhaps some updates on MS 2007 have been incorporated to make this easier, I just don't know. Sorry for being such a noob at this, but I hope to receive answers.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,215,523
Messages
6,125,323
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top