View Single Post
  #14   Report Post  
Mervyn Thomas
 
Posts: n/a
Default

Bob - I couln't get that bit of code to work. These lines paste in red
colour in ThisWorkBook

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As
Boolean, Cancel As Boolean)

and then the whole thing bugs when the file is opened with the yellow on the
previous "Private Sub... that works OK on its own.
Full code that doesn't work now is:

Public WithEvents App As Application

Private Sub Workbook_Open()
Set App = Application
End Sub

Private Sub App_WindowActivate(ByVal Wb As Workbook, ByVal Wn As Window)
Wn.Caption = Wb.FullName
End Sub

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As
Boolean, Cancel As Boolean)
App_WindowActivate Wb, Windows(Wb.Name)
End Sub










"Bob Phillips" wrote in message
...
add this event procedure to ThisWorkbook

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As
Boolean, Cancel As Boolean)
App_WindowActivate Wb, Windows(Wb.Name)
End Sub



--
HTH

Bob Phillips

"Mervyn Thomas" wrote in message
...
Thanks that works very well, but how would you refresh the caption
without
reopening the file - sometimes we do a <File Save as to a different
drive
and that is where the confusion usually starts?


"Bob Phillips" wrote in message
...
Public WithEvents App As Application

Private Sub Workbook_Open()
Set App = Application
End Sub

Private Sub App_WindowActivate(ByVal Wb As Workbook, ByVal Wn As
Window)
Wn.Caption = Wb.FullName
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

"Mervyn Thomas" wrote in message
...
The default seems to be to show the filename on the top border in

Excel.
Is
there any way to include the full path including the drive letter as
well?
I have an operator who gets confused as to where she is and this would

be
really nice.