Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default changing the application name in the title bar

I once read there was a way to change the name of an application as it
appears in the Excel title bar. That is, to replace the "Microsoft Excel -
filename.xls" with whatever name you want to use.

I tried using "Application.Name = "my application name" but I got the error
message "Can't assign to read-only property." Is there a way to accomplish
this?

Thanks in advance

Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default changing the application name in the title bar

Application.Caption = "MyNewCaption"

--

Vasant

"Paul James" wrote in message
...
I once read there was a way to change the name of an application as it
appears in the Excel title bar. That is, to replace the "Microsoft

Excel -
filename.xls" with whatever name you want to use.

I tried using "Application.Name = "my application name" but I got the

error
message "Can't assign to read-only property." Is there a way to

accomplish
this?

Thanks in advance

Paul




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default changing the application name in the title bar

Application.Caption = "MyNewCaption"

So that's how you do it!

Thanks (again), Vasant.

Question: I notice that when I do this, it not only puts "MyNewCaption" in
the title bar, but it also adds the filename to the string I assign to the
Caption property. In other words, it places "MyNewCaption - MyFilename.xls"
in the title bar. Is there a parameter I can add to the property assignment
that would remove the filename from the caption, and only display the
assigned string?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default changing the application name in the title bar

I think that this is actually showing the activeworkbook's name since you have
the workbook's window maximized. I think it's excel's way of helping you.

(If you restore the workbook's window (not the application's window), to less
than maximized, you'll see that the appliation caption doesn't show the
workbook's name.

Paul James wrote:

Application.Caption = "MyNewCaption"

So that's how you do it!

Thanks (again), Vasant.

Question: I notice that when I do this, it not only puts "MyNewCaption" in
the title bar, but it also adds the filename to the string I assign to the
Caption property. In other words, it places "MyNewCaption - MyFilename.xls"
in the title bar. Is there a parameter I can add to the property assignment
that would remove the filename from the caption, and only display the
assigned string?


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default changing the application name in the title bar

Or add the activewindow.caption

Sub bothcaptions()
Application.Caption = "MyApplication"
ActiveWindow.Caption = ""
End Sub

Gord

On Mon, 22 Dec 2003 17:33:08 -0600, Dave Peterson wrote:

I think that this is actually showing the activeworkbook's name since you have
the workbook's window maximized. I think it's excel's way of helping you.

(If you restore the workbook's window (not the application's window), to less
than maximized, you'll see that the appliation caption doesn't show the
workbook's name.

Paul James wrote:

Application.Caption = "MyNewCaption"

So that's how you do it!

Thanks (again), Vasant.

Question: I notice that when I do this, it not only puts "MyNewCaption" in
the title bar, but it also adds the filename to the string I assign to the
Caption property. In other words, it places "MyNewCaption - MyFilename.xls"
in the title bar. Is there a parameter I can add to the property assignment
that would remove the filename from the caption, and only display the
assigned string?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default changing the application name in the title bar

Better answer.

Gord, Dibben wrote:

Or add the activewindow.caption

Sub bothcaptions()
Application.Caption = "MyApplication"
ActiveWindow.Caption = ""
End Sub

Gord

On Mon, 22 Dec 2003 17:33:08 -0600, Dave Peterson wrote:

I think that this is actually showing the activeworkbook's name since you have
the workbook's window maximized. I think it's excel's way of helping you.

(If you restore the workbook's window (not the application's window), to less
than maximized, you'll see that the appliation caption doesn't show the
workbook's name.

Paul James wrote:

Application.Caption = "MyNewCaption"

So that's how you do it!

Thanks (again), Vasant.

Question: I notice that when I do this, it not only puts "MyNewCaption" in
the title bar, but it also adds the filename to the string I assign to the
Caption property. In other words, it places "MyNewCaption - MyFilename.xls"
in the title bar. Is there a parameter I can add to the property assignment
that would remove the filename from the caption, and only display the
assigned string?


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default changing the application name in the title bar

Hi Paul:

Here's a complete set of routines that I think will do what you want:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Caption = ""
End Sub

Private Sub Workbook_Open()
Application.Caption = "MyNewCaption"
With ActiveWindow
If .WindowState = xlMaximized Then
.Caption = ""
Else
.Caption = Name
End If
End With
End Sub

Private Sub Workbook_WindowResize(ByVal Wn As Window)
With Wn
If .WindowState = xlMaximized Then
.Caption = ""
Else
.Caption = Name
End If
End With
End Sub

Of course, these go in the ThisWorkbook moduile.

If you are going to have other workbooks open at the same time and only want
this behavior for one of them, you will have to add similar code to the
Activate and Deactivate events for the workbook as well. Also, if you want
to get really sophisticated, check out John Walkenbach's site for what to do
to prevent the BeforeClose event from firing if the user changes his/her
mind and does not close the workbook.

http://j-walk.com/ss/excel/tips/tip78.htm

Regards,

Vasant.


"Paul James" wrote in message
...
Application.Caption = "MyNewCaption"

So that's how you do it!

Thanks (again), Vasant.

Question: I notice that when I do this, it not only puts "MyNewCaption" in
the title bar, but it also adds the filename to the string I assign to the
Caption property. In other words, it places "MyNewCaption -

MyFilename.xls"
in the title bar. Is there a parameter I can add to the property

assignment
that would remove the filename from the caption, and only display the
assigned string?




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default changing the application name in the title bar

Paul

Vasant gave you the code for this but must be noted that this is not a
permanent change and has to be re-done each time you close out and re-start
Excel.

Place the code into a Thisworkbook Workbook_Open Sub or a General Module
Auto_Open Sub.

Gord Dibben Excel MVP

On Mon, 22 Dec 2003 13:55:19 -0800, "Paul James"
wrote:

I once read there was a way to change the name of an application as it
appears in the Excel title bar. That is, to replace the "Microsoft Excel -
filename.xls" with whatever name you want to use.

I tried using "Application.Name = "my application name" but I got the error
message "Can't assign to read-only property." Is there a way to accomplish
this?

Thanks in advance

Paul


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default changing the application name in the title bar

Thanks, Gord. That's good information to have.

I'll put it in the Auto_Open sub.


Another question:

I only need the custom caption while a particular workbook is open. If I
want to reset the caption when that workbook closes, can I do that by simply
putting

Application.Caption = "Microsoft Excel"

in the Auto_Close procedure?

Thanks


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default changing the application name in the title bar

application.caption = ""

would reset it.



Paul James wrote:

Thanks, Gord. That's good information to have.

I'll put it in the Auto_Open sub.

Another question:

I only need the custom caption while a particular workbook is open. If I
want to reset the caption when that workbook closes, can I do that by simply
putting

Application.Caption = "Microsoft Excel"

in the Auto_Close procedure?

Thanks


--

Dave Peterson



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default changing the application name in the title bar

Paul

Yes, you can reset it in the Auto_close code.

If you leave it blank, it will default to "Microsoft Excel"

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Caption = ""
End Sub

Gord Dibben Excel MVP

On Mon, 22 Dec 2003 15:04:59 -0800, "Paul James"
wrote:

Thanks, Gord. That's good information to have.

I'll put it in the Auto_Open sub.


Another question:

I only need the custom caption while a particular workbook is open. If I
want to reset the caption when that workbook closes, can I do that by simply
putting

Application.Caption = "Microsoft Excel"

in the Auto_Close procedure?

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing language of application Alfredo_CPA Setting up and Configuration of Excel 10 October 16th 08 02:14 AM
changing name of data sheet in a application Octet32 New Users to Excel 0 June 11th 08 01:33 PM
changing the title of an 'application.dialog(xldialogopen)' Reiner Giesen Excel Programming 0 November 20th 03 04:36 PM
changing chart title via vba? basis Excel Programming 2 October 20th 03 08:07 PM
changing chart title via vba? basis[_2_] Excel Programming 0 October 20th 03 05:47 PM


All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"