I'm trying to create a function to upload multiple files at the same time but even with only one I get an error. What can I be programming wrong?
'FILE DIALOG OPENS UPLOAD PANEL
Private Sub Comando715_Click()
Call Selectfile
End Sub
The function created is as follows:
Public Function Selectfile() As String
Dim Fd As FileDialog
Set Fd = Application.FileDialog(msoFileDialogOpen)
With Fd
.AllowMultiSelect = False
.Title = "Por favor selecione as fotos desta peça a anexar"
If .Show = True Then
Selectfile = .SelectedItems(1)
Me.Anexo412 = Selectfile
Else
Exit Function
End If
Set Fd = Nothing
End With
End Function
The error that gives me in VBA is in the following line
Dim Fd As FileDialog
Can someone help me to complete the code?