Pull picture into userform multipage

berty2000

Board Regular
Joined
Mar 29, 2011
Messages
71
Hi
Im trying to pull images from hard drive locations into a userform multipage, but it displays the image behind the multipage.
I'm trying to put the picture in Image1 on the userform. This is what i got so far.

Code:
Sub Addpictures()

 MultiPage1.Value = 0
    Set img = poo1.Controls.Add("Forms.Image.1")
 
    With img
        .Picture = LoadPicture("C:\Pictures to Use\team1.jpg")  'Image Path here

        'Align the Picture Size
        .PictureSizeMode = fmPictureSizeModeStretch

        'Image Position
        .Left = 50
        .Top = 10
    End With
     
End Sub
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,309
It looks like you want the image placed on the first page of your multipage control. If so, try...

Code:
Set img = poo1.MultiPage1.Pages(0).Controls.Add("Forms.Image.1")

Hope this helps!
 

berty2000

Board Regular
Joined
Mar 29, 2011
Messages
71
That brings it forward perfectly, what if i need to place it in an Image2 box on that multipage can that be done or should i move it to position with

Code:
        'Image Position
        .Left = 350
        .Top = 100
 

Watch MrExcel Video

Forum statistics

Threads
1,109,433
Messages
5,528,738
Members
409,831
Latest member
KT50

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top