YasserKhalil
09-26-2017, 06:03 AM
Hello everyone
I need to insert a picture using filedialog
Private Sub CommandButton1_Click() Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogOpen)
dlg.InitialFileName = "D:\Alwared\"
If dlg.Show Then
Me.Image1.Picture = LoadPicture(dlg)
Else
MsgBox "File Not Selected", vbExclamation
End If
Set dlg = Nothing
End Sub
I got an error when trying to insert the picture
Any idea?
I need to insert a picture using filedialog
Private Sub CommandButton1_Click() Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogOpen)
dlg.InitialFileName = "D:\Alwared\"
If dlg.Show Then
Me.Image1.Picture = LoadPicture(dlg)
Else
MsgBox "File Not Selected", vbExclamation
End If
Set dlg = Nothing
End Sub
I got an error when trying to insert the picture
Any idea?