Hi Guys
I am getting compile error: User defined type not defined in the red line in below code.
Any help would be much appreciated.
Thanks
I am getting compile error: User defined type not defined in the red line in below code.
Code:
Private Sub CommandButton1_Click()
ChooseFile
End Sub
Sub ChooseFile()
[COLOR=red]Dim fd As FileDialog[/COLOR]
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'get the number of the button chosen
Dim FileChosen As Integer
FileChosen = fd.Show
If FileChosen <> -1 Then
'didn't choose anything (clicked on CANCEL)
MsgBox "You chose cancel"
Else
'display name and path of file chosen
Text0 = fd.SelectedItems(1)
End If
End Sub
Any help would be much appreciated.
Thanks