File Path


Posted by Ray Deis on February 19, 2001 8:17 PM


Is there a way to display the full path of the current file in the Excel Window Title bar?

Posted by Dave Hawley on February 19, 2001 8:47 PM

Ray, you will need to place this code in Workbook Module of your personal macro workbook.


Private Sub Workbook_Open()
Application.ActiveWindow.Caption = ActiveWorkbook.FullName
End Sub


To get to it Push Alt+F11 then Ctrl+R and in th "Project Explorer" double click "ThisWorkbook" in the "Personal.xls"


Dave

OzGrid Business Applications

Posted by JAF on February 20, 2001 3:51 AM

Hide "Microsoft Excel"??

Dave

The code supplied adds the full path.

Is there any way to stop it from prefixing this with "Microsoft Excel - " so that it diaplays the full path and nothing else??

Posted by Celia on February 20, 2001 4:09 AM

Re: Hide "Microsoft Excel"??

Dave The code supplied adds the full path. Is there any way to stop it from prefixing this with "Microsoft Excel - " so that it diaplays the full path and nothing else??


JAF
Here's one way :-
Application.Caption = " "
To get it back again :-
Application.Caption = ""
Celia

Posted by JAF on February 20, 2001 7:02 AM

One last question.

Celia

Thanks for the reply. I can now set the caption to display what I want with:
Sub Custom_Caption()
Application.Caption = "JAF"
Application.ActiveWindow.Caption = ActiveWorkbook.FullName
End Sub

However, when I reset it using the code:
Sub Default_Caption()
Application.Caption = ""
Application.ActiveWindow.Caption = ActiveWorkbook.Name
End Sub
the ActiveWorkbook.Name suffixes the filename with .xls (I have the 3 letter extensions hidden by default).

Is it possible to reset the caption to display the filename but without the 3 letter extension?

JAF

Dave The code supplied adds the full path. Is there any way to stop it from prefixing this with "Microsoft Excel - " so that it diaplays the full path and nothing else??

Posted by Celia on February 20, 2001 3:16 PM

Re: One last question.

Celia Thanks for the reply. I can now set the caption to display what I want with:


JAF
Try this :-

Sub Default_Caption()
Application.Caption = ""
Application.ActiveWindow.Caption = Application.Substitute(ActiveWorkbook.Name, ".xls", "")
End Sub

Celia



Posted by Ray Deis on February 20, 2001 7:37 PM

Thanks Dave. Now that it works for one document is there a way to have the full path automatically appear for every file that is opened without having to add the code to every workbook