I want to get file name from path.


 Dim wb2 As Workbook, temp
                
            FileOnly = Dir("D:\Input\Report1.xlsx")
            MsgBox (FileOnly)   ------> show Report1.xlsx  (true)
            Set wb2 = Workbooks(FileOnly)
But output in wb2 = nothing

Please guide me for solve it.