Hi everyone,
I have the following code to browse a file in disck. But I get an error message over "If desPathName = False Then". How come?
Sincerely,
lolo^^
I have the following code to browse a file in disck. But I get an error message over "If desPathName = False Then". How come?
Code:
Sub browseFile()
desPathName = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls*), *.xls*", Title:="Please select a file")
If desPathName = False Then
MsgBox "Stopping because you did not select a file. Reselect a destination file through the menu"
Exit Sub
Else
Workbooks.Open Filename:=desPathName
Set des = Workbooks.Open(desPathName, True, False)
Set desSheet = des.Worksheets(desWorksheetName)
End If
End Sub
Sincerely,
lolo^^