Had a search but could not find anything that addressed this issue.
When running the following code I get the above error, As only one file will be selected at any time, going for the array approach seems excessive.
The files to be opened are all xls extension, running under Excel MSO 2010
Any ideas what I am failing to understand?
'If at first you don't succeed, then your hammer is below specifications'
When running the following code I get the above error, As only one file will be selected at any time, going for the array approach seems excessive.
The files to be opened are all xls extension, running under Excel MSO 2010
Any ideas what I am failing to understand?
Code:
Private Sub CommandButton2_Click()
Dim NewFN As String
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files(*.xls),*.xls", Title:="Select File Name to Open", MultiSelect:=False)
If NewFN = False Then
MsgBox "No File was selected"
Exit Sub
Else
Workbook.Open NewFN
End If
End Sub
'If at first you don't succeed, then your hammer is below specifications'