PDA

View Full Version : Solved: Add text in title bar



gnod
06-08-2007, 04:04 AM
hi,

how can i add another text in the title bar? i want to add the "(Deployment Date: June 8, 2007)" but not part of the excel filename.

for ex:

Microsoft Excel - Expense.xls (Deployment Date: June 8, 2007)


thanks..

Bob Phillips
06-08-2007, 05:46 AM
Public WithEvents App As Application

Private Sub App_WindowActivate(ByVal Wb As Workbook, ByVal Wn As Window)
Wn.Caption = " Microsoft Excel - Expense.xls (Deployment Date: " & Format(Date, "mmmm d, yyyy") & ")"
End Sub

Private Sub Workbook_Open()
Set App = Application
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

gnod
06-08-2007, 07:06 AM
Thanks XLD.. :thumb
i'll use it as my reference if the user is using the updated file.. thanks :)

gnod
06-08-2007, 07:17 AM
when i use your code then create a new or open a workbook, the title bar is still Expense.xls (Deployment June 8, 2007)..
can it be only applicable to the workbook that has your code..
thanks..

gnod
06-08-2007, 07:21 AM
i use this code so it will be only applicable to this workbook..


Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Wn.Caption = " Microsoft Excel - Expense.xls (Deployment Date: " & Format(Date, "mmmm d, yyyy") & ")"
End Sub