Private Sub cmdGetFile_Click()
Dim fd As FileDialog
Dim ffs As FileDialogFilters
On Error GoTo Problem
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
Set ffs = .Filters
With ffs
.clear
.add "Pictures", "*.jpg"
End With
.AllowMultiSelect = False
If .show = False Then Exit Sub
Image1.Picture = LoadPicture(.SelectedItems(1))
End With
Exit Sub
Problem:
MsgBox "That was not a valid picture"
End Sub
|