Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Best Way to Read the Registry? | Excel Programming | |||
HTML/XML Import Error -ExcelName | Excel Programming | |||
Value from Registry | Excel Programming | |||
Registry | Excel Programming | |||
Registry | Excel Programming |