Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Updating ExcelName Registry Key

I have created an App in Excel that I would like to display the
"Window Caption - MyApp Name" instead MyApp filename and " - Microsoft
Excel" in the Title Bar.

Is there a way to update the "HKEY_CURRENT_USER\Software\Microsoft
\Office\12.0\Excel\ExcelName" registry key everytime the app opens?

I can't even manually set it in the regitsry and open Excel. The key
automatically resets to "Microsoft Excel" after the file loads.
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Updating ExcelName Registry Key

On Aug 21, 2:27 pm, Don wrote:
I have created an App in Excel that I would like to display the
"Window Caption - MyApp Name" instead MyApp filename and " - Microsoft
Excel" in the Title Bar.

Is there a way to update the "HKEY_CURRENT_USER\Software\Microsoft
\Office\12.0\Excel\ExcelName" registry key everytime the app opens?

I can't even manually set it in the regitsry and open Excel. The key
automatically resets to "Microsoft Excel" after the file loads.
Thanks!


Hello Don,

You can "brand" Excel using a few API calls. Place these in a Standard
VBA Module.

'This will be used to find the Window to Excel
Public Declare Function FindWindow _
Lib "user32.dll" _
Alias "FindWindowA" _
(ByVal lpszClass As String, _
ByVal lpszWindow As String) As Long

'This will be used to change the Window Caption
Private Declare Function SetWindowText _
Lib "user32.dll" _
Alias "SetWindowTextA" _
(ByVal hWnd As Long, _
ByVal lpszBuffer As String) As Long

Public Sub BrandExcel()
Dim NewTitle As String
Dim hWnd As Long
Dim Retval
' Change NewTitle to what you want
NewTitle = "Book 1"
' Returns zero if function fails
hWnd = FindWindow("XLMAIN", vbNullString)
' Return 1 if title was changed
Retval = SetWindowText(hWnd, NewTitle)
End Sub

Sincerely,
Leith Ross


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Updating ExcelName Registry Key

You may want to use an event that changes the caption when your workbook is
active.

Chip Pearson has some instructions on events:
http://www.cpearson.com/excel/events.htm

David McRitchie has some notes, too:
http://www.mvps.org/dmcritchie/excel/event.htm

Don wrote:

I have created an App in Excel that I would like to display the
"Window Caption - MyApp Name" instead MyApp filename and " - Microsoft
Excel" in the Title Bar.

Is there a way to update the "HKEY_CURRENT_USER\Software\Microsoft
\Office\12.0\Excel\ExcelName" registry key everytime the app opens?

I can't even manually set it in the regitsry and open Excel. The key
automatically resets to "Microsoft Excel" after the file loads.
Thanks!


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Updating ExcelName Registry Key

Another one -

Sub AppCap(sCaption As String)

If Len(sCaption) Then
ActiveWindow.Caption = ""
Application.Caption = sCaption
Else
Application.Caption = ""
ActiveWindow.Caption = False
End If

End Sub

Sub test3()
AppCap "My App Caption"

' pass an empty string to reset
' AppCap ""
End Sub

Regards,
Peter T

"Don" wrote in message
ups.com...
I have created an App in Excel that I would like to display the
"Window Caption - MyApp Name" instead MyApp filename and " - Microsoft
Excel" in the Title Bar.

Is there a way to update the "HKEY_CURRENT_USER\Software\Microsoft
\Office\12.0\Excel\ExcelName" registry key everytime the app opens?

I can't even manually set it in the regitsry and open Excel. The key
automatically resets to "Microsoft Excel" after the file loads.
Thanks!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Updating ExcelName Registry Key

On Aug 22, 2:11 am, "Peter T" <peter_t@discussions wrote:
Another one -

Sub AppCap(sCaption As String)

If Len(sCaption) Then
ActiveWindow.Caption = ""
Application.Caption = sCaption
Else
Application.Caption = ""
ActiveWindow.Caption = False
End If

End Sub

Sub test3()
AppCap "My App Caption"

' pass an empty string to reset
' AppCap ""
End Sub

Regards,
Peter T

"Don" wrote in message

ups.com...



I have created an App in Excel that I would like to display the
"Window Caption - MyApp Name" instead MyApp filename and " - Microsoft
Excel" in the Title Bar.


Is there a way to update the "HKEY_CURRENT_USER\Software\Microsoft
\Office\12.0\Excel\ExcelName" registry key everytime the app opens?


I can't even manually set it in the regitsry and open Excel. The key
automatically resets to "Microsoft Excel" after the file loads.
Thanks!- Hide quoted text -


- Show quoted text -


Thanks very much, everyone. I will have to do some tweaks because
excel 2003 and 2007 behave differently with those subs. Yet another
layer of macros to run based off of the version of Excel being used...

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
Best Way to Read the Registry? JK Excel Programming 3 October 25th 04 05:55 PM
HTML/XML Import Error -ExcelName smcclure Excel Programming 0 October 22nd 04 06:19 AM
Value from Registry Roy Lasris Excel Programming 3 February 23rd 04 11:53 PM
Registry Tom Ogilvy Excel Programming 1 July 16th 03 01:02 AM
Registry Patrick Molloy[_4_] Excel Programming 0 July 15th 03 12:45 PM


All times are GMT +1. The time now is 01:20 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"