Hi,
Run-Time Error '438': Object Doesn't support this property or method.
I'm creating a button to upload a picture file but I'm getting the above error code.
Run-Time Error '438': Object Doesn't support this property or method.
I'm creating a button to upload a picture file but I'm getting the above error code.
Code:
Private Sub CmdAddPhoto_Click()
Dim f As Object
Dim strfile As String
Dim strfolder As String
Dim VarItem As Variant
Set f = Application.FileDialog(3)
f.allowMultiSelect = True
If f.Show Then
For Each VarItem In f.SelectionItems -------------> This where I get an error.
strfile = Dir(VarItem)
strfolder = Left(VarItem, Len(VarItem) - Len(strfile))
MsgBox "Folder" & strfolder & vbCrLf & _
"File: " & strfile
ImagePathControl = strfolder + strfile
Next
End If
Set f = Nothing
End Sub