PC Review


Reply
Thread Tools Rate Thread

How to change the default caption of a workbook to the full pathname?

 
 
SteveM
Guest
Posts: n/a
 
      26th Dec 2007
The subject sums it up. I do optimization and simulation modeling
using Excel as a data management platform. But find that with
multiple versions of a model open, I sometimes work on or save/not
save the wrong version. Any visual cue I can find would be great.
For this solution I've inserted a simple line of code into the
Workbook Open sub:

Private Sub Workbook_Open()

ThisWorkbook.Application.Caption = ThisWorkbook.Path

End Sub

I then saved it as a template so new workbooks will contain it.

But is there a way to make the default the full pathname without using
a macro?

And is there a way to change my existing workbooks' caption to the
full pathname without without too much VBA trouble?

Thanks Much,

SteveM
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      26th Dec 2007
Probably the simplest way would be to write an Add In that uses application
events to catch the WorkbookActivate and WorkbookDeactivate events. E.g.,

Private Sub App_WorkbookActivate(ByVal Wb As Workbook)
Application.Caption = Wb.FullName
End Sub

Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
Application.Caption = vbNullString
End Sub

See www.cpearson.com/Excel/AppEvent.aspx for information about using
application events. See www.cpearson.com/Excel/CreateAddIn.aspx for
information about writing XLA add-ins.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"SteveM" <(E-Mail Removed)> wrote in message
news:03bf2e6d-d9c3-4609-8c23-(E-Mail Removed)...
> The subject sums it up. I do optimization and simulation modeling
> using Excel as a data management platform. But find that with
> multiple versions of a model open, I sometimes work on or save/not
> save the wrong version. Any visual cue I can find would be great.
> For this solution I've inserted a simple line of code into the
> Workbook Open sub:
>
> Private Sub Workbook_Open()
>
> ThisWorkbook.Application.Caption = ThisWorkbook.Path
>
> End Sub
>
> I then saved it as a template so new workbooks will contain it.
>
> But is there a way to make the default the full pathname without using
> a macro?
>
> And is there a way to change my existing workbooks' caption to the
> full pathname without without too much VBA trouble?
>
> Thanks Much,
>
> SteveM


 
Reply With Quote
 
SteveM
Guest
Posts: n/a
 
      26th Dec 2007
On Dec 26, 9:53 am, "Chip Pearson" <c...@cpearson.com> wrote:
> Probably the simplest way would be to write an Add In that uses application
> events to catch the WorkbookActivate and WorkbookDeactivate events. E.g.,
>
> Private Sub App_WorkbookActivate(ByVal Wb As Workbook)
> Application.Caption = Wb.FullName
> End Sub
>
> Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
> Application.Caption = vbNullString
> End Sub
>
> Seewww.cpearson.com/Excel/AppEvent.aspxfor information about using
> application events. Seewww.cpearson.com/Excel/CreateAddIn.aspxfor
> information about writing XLA add-ins.
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel, 10 Years
> Pearson Software Consultingwww.cpearson.com
> (email on the web site)
>
> "SteveM" <sbm...@vzavenue.net> wrote in message
>
> news:03bf2e6d-d9c3-4609-8c23-(E-Mail Removed)...
>
> > The subject sums it up. I do optimization and simulation modeling
> > using Excel as a data management platform. But find that with
> > multiple versions of a model open, I sometimes work on or save/not
> > save the wrong version. Any visual cue I can find would be great.
> > For this solution I've inserted a simple line of code into the
> > Workbook Open sub:

>
> > Private Sub Workbook_Open()

>
> > ThisWorkbook.Application.Caption = ThisWorkbook.Path

>
> > End Sub

>
> > I then saved it as a template so new workbooks will contain it.

>
> > But is there a way to make the default the full pathname without using
> > a macro?

>
> > And is there a way to change my existing workbooks' caption to the
> > full pathname without without too much VBA trouble?

>
> > Thanks Much,

>
> > SteveM


Chip, nice simple solution. Thanks for the advice.

SteveM
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change default caption color in References/Insert Caption? Nick Piazza Microsoft Word Document Management 4 13th Jul 2009 07:00 PM
Change Caption on the Default Contact Form Christine Rutter Microsoft Outlook Form Programming 1 28th Jun 2008 05:43 PM
Full Pathname in Title bar SF Microsoft Word New Users 4 7th Oct 2005 02:19 AM
How can I remove pathname from caption for icon of embedded objec. =?Utf-8?B?b3RyZmFuODQxMjg=?= Microsoft Word Document Management 0 29th Apr 2005 06:53 PM
Full Pathname in Titlebar =?Utf-8?B?R3JlZw==?= Microsoft Excel Setup 3 25th Mar 2005 01:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 AM.