MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Name at top of excel window


Posted by Darnel on December 13, 2000 12:25 PM

I work with excel documents over a network and often have multiple copies. Is there a way to have Excel show more than
just the name "Book 1" on the top of the screen? Such as "F:\workprojects\book1". Thanks.


Posted by Tim Francis-Wright on December 13, 2000 12:47 PM

Sub NameWindow()
ThisWorkbook.Windows(1).Caption = ThisWorkbook.Fullname
End Sub

This should do the trick. You might want
this to be in an Auto_Open sub or
an WorkBook_Open sub (in the ThisWorkbook object).

Good luck!


Posted by Darnel on December 13, 2000 1:02 PM

I don't understand... Where do I enter Sub NameWindow() ??


Posted by Tim Francis-Wright on December 13, 2000 1:26 PM

This is for Excel 97 and up:

You'll want to put this code in a Visual
Basic module: hit Alt-F11, then hit control-R
(to see the Project Explorer). Double-click
on "This Workbook." You'll then see a new
window; pull the left dropdown box to "Workbook";
the right window will default to "Open" and
you will see in the main window:

Private Sub Workbook_Open()

End Sub

In between these two lines, type
ThisWorkbook.Windows(1).Caption = ThisWorkbook.Fullname

--------------------------

For Excel 95:

Insert a Module sheet

Type the following in that sheet:
Sub Auto_Open()
ThisWorkbook.Windows(1).Caption = ThisWorkbook.Fullname
End Sub

This should do the trick.