Inserting graphics into user from

bralew

New Member
Joined
Aug 25, 2016
Messages
17
Hi, can anyone help. I've gone through a tutorial whereby I was able to use a combo box to load a graphical illustration and tried utilising it in my own userform.
I changed the references from combobox1 to combobox2 etc but I cannot get the box to show the files, I'm confused as it works fine in my experimental workbook. It may have something to do with the initialise instruction because the userform is fired by a button, but not sure.
Any help would be much appreciated. Here's the code:





Code:
Private Sub UserForm1_Initialize()
    Dim fs, f, f1, fc, s
    Dim folderspec


    folderspec = "\\SVR2\Data\Common Folders\Technical & QA\CAD\Images for labels\"


    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(folderspec)
    Set fc = f.Files


    ComboBox2.Clear


    For Each f1 In fc


        ComboBox2.AddItem f1.Name


    Next f1


    ComboBox2.SetFocus
    ComboBox2.ListRows = 20


    Application.SendKeys "^{F4}"


End Sub




Private Sub ComboBox2_Change()
    Image1.Picture = LoadPicture("\\SVR2\Data\Common Folders\Technical & QA\CAD\Images for labels\" & ComboBox2)
End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi, can anyone help. I've gone through a tutorial whereby I was able to use a combo box to load a graphical illustration and tried utilising it in my own userform.
I changed the references from combobox1 to combobox2 etc but I cannot get the box to show the files, I'm confused as it works fine in my experimental workbook. It may have something to do with the initialise instruction because the userform is fired by a button, but not sure.

Through a tutorial ? Really ? How to incorporate images into user form. [SOLVED]
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

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