I'm using the following code to import a another file, I thought I fixed the issue of getting a runtime error, but now it doesn't open the selected file and I get the MSG Box.
Dim sPath As String
Dim sFile
Dim ws1 As Worksheet
Set ws1 = Sheet1
sPath = "\\Address\Folder1\Folder2\Folder3" & ws1.Range("A2")
If SetFilePath(sPath) = 0 Then
MsgBox "Error in setting the path - " & sPath
Else
sFile = Application.GetOpenFilename("Excel,*.xls;*.xlsx")
If sFile <> False Then Set WB = Workbooks.Open(sFile) Else
MsgBox "No File Selected"
Exit Sub
End If
Dim sPath As String
Dim sFile
Dim ws1 As Worksheet
Set ws1 = Sheet1
sPath = "\\Address\Folder1\Folder2\Folder3" & ws1.Range("A2")
If SetFilePath(sPath) = 0 Then
MsgBox "Error in setting the path - " & sPath
Else
sFile = Application.GetOpenFilename("Excel,*.xls;*.xlsx")
If sFile <> False Then Set WB = Workbooks.Open(sFile) Else
MsgBox "No File Selected"
Exit Sub
End If