I thought that you said it worked, the code that i gave you will pick the path up from A1. You need to type the path into it.
Sub workOnSheet()
Dim FileName As Variant
Dim Filt As String, Title As String
Dim FilterIndex As Integer, Response As Integer
Dim NameOnly As String
' Set Drive letter
ChDrive "E:\"
' Set to Specified Path\Folder
'Path entered into A1
If Not IsEmpty(ActiveSheet.Cells(1, 1)) Then
ChDir ActiveSheet.Cells(1, 1).Value
Else: MsgBox "no path entered", vbCritical, "Error"
Exit Sub
End If
' Set File Filter
'Filt = "PID files (*.pid), *.pid"
Filt = "PIW files (*.xls), *.xls"
' Set *.* to Default
FilterIndex = 5
' Set Dialogue Box Caption
Title = "Please select a different File"
' Get FileName
FileName = Application.GetOpenFilename(FileFilter:=Filt, _
FilterIndex:=FilterIndex, Title:=Title)
' Exit if Dialogue box cancelled
If FileName = False Then
Response = MsgBox("No File was selected", vbOKOnly & vbCritical, "Selection Error")
End
Exit Sub
End If
' Display Full Path & File Name
Response = MsgBox("You selected " & FileName, vbInformation, "Proceed")
NameOnly = GetFileName(CStr(FileName))
DEFName = NameOnly
' Open Selected Workbook
Workbooks.Open FileName
Bookmarks