Forum Discussion
Oliversanabia
May 11, 2022Copper Contributor
Vba Incert a image on a image (activex control)
Hello, I have being trying to insert a image in a image (activex control). I managed to find a code that lets me press a button that opens the file explorer so that I can select the image in questi...
HansVogelaar
May 11, 2022MVP
Like this:
Private Sub CommandButton1_Click()
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Picture files (*.jpg, *.png, *.gif)", "*.jpg,*.png,*.gif"
.InitialFileName = "C:\yourfolder\*.jpg"
If .Show Then
Image1.Picture = LoadPicture(.SelectedItems(1))
End If
End With
End Sub