Morning,

The following code will extract the file name and filepath of a used file and populate cells on a sheet with this information;

The problem i have is that the filepath won't populate the cell range named but i cannot see an error.

Has anyone got any ideas as to why?

Application.StatusBar = "Latest mappings being obtained and copied into this file ..."
    MsgBox "Please select the latest main mapping file"
    ChDir "\\Via.novonet\dfs\LIFE\F\INVReporting\CONFIDENTIAL\Inv_Reporting_2012\Source Files\Mappings\"
    FName = Application.GetOpenFilename(FileFilter:="Excel files (*.xls*), *.xls*", Title:="Please open the most recent mapping file ...")
    
    If FName = "False" Then
        MsgBox "You have not selected a file - macro stopped"
        Exit Sub
    End If
    
    'Open mapping file
    Workbooks.Open FName, UpdateLinks:=False, ReadOnly:=True
    FName = ActiveWorkbook.Name
    
    Mylen = Len(FName)
    Mypos = InStrRev(FName, "\", -1, vbTextCompare)
    Mypos = Mylen - Mypos
    MyFile = Right(FName, Mypos)
    
    HPath = Left(FName, (Len(FName) - Len(MyFile)))
    IPath = Right(HPath, (Len(HPath)))

    ThisWorkbook.Worksheets("Start").Range("C6").Value = MyFile
    ThisWorkbook.Worksheets("Start").Range("E6").Value = IPath
    
End Sub