Say, I\'m writing a VBA inside my excel file sample.xls. Now I want to get the full path of sample.xls in my VBA. How do I do it?
There is a universal way to get this:
Function FileName() As String FileName = Mid(Application.Caption, 1, InStrRev(Application.Caption, "-") - 2) End Function