Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing the text in the top excel window bar to display your own. (Tip & Question).

In VBA I am using

Application.Caption = "my own text"
ActiveWindow.Caption = "my own text"

to change the text in the Excel Window header at the top of m
workbook. However, in the top left hand corner I still have the gree
Excel icon. what do I need to use to change the Excel icon picture t
my own, or to get rid of it completely?
Is it possible?
Tnx, ironmouse.

pls note that this is the second time I have posted this question.
Last week I posted it and had 15 views but no replies. I'm no
hopeful.....

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Changing the text in the top excel window bar to display your own. (Tip & Question).

Hi ironmouse,
In ThisWorkbook module:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" _
(ByVal hInst As Long, ByVal lpszExeFileName As String _
, ByVal nIconIndex As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer _
, ByVal lParam As Any) As Long

Private Sub Workbook_Open()
AppSetIcon False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
AppSetIcon True
End Sub

Private Sub AppSetIcon(Optional Restore As Boolean = False)
Dim hwnd As Long, hIcon As Long
If Not Restore Then
If Dir(ThisWorkbook.Path & "\MyIcon.ico") = "" Then Exit Sub
hIcon = ExtractIcon(0, ThisWorkbook.Path & "\MyIcon.ico", 0)
End If
hwnd = FindWindow(vbNullString, Application.Caption)
SendMessage hwnd, &H80, 0, hIcon ' Small Icon
SendMessage hwnd, &H80, 1, hIcon ' Big Icon
End Sub

Regards,
MP

"ironmouse " a écrit dans le message de
...
In VBA I am using

Application.Caption = "my own text"
ActiveWindow.Caption = "my own text"

to change the text in the Excel Window header at the top of my
workbook. However, in the top left hand corner I still have the green
Excel icon. what do I need to use to change the Excel icon picture to
my own, or to get rid of it completely?
Is it possible?
Tnx, ironmouse.

pls note that this is the second time I have posted this question.
Last week I posted it and had 15 views but no replies. I'm not
hopeful......


---
Message posted from http://www.ExcelForum.com/



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
In Excel 2007, the open file window does not display the folders p Gilbert Excel Discussion (Misc queries) 0 March 3rd 10 04:06 PM
display program and file name at top of window in Excel Trish Excel Discussion (Misc queries) 2 October 12th 07 09:46 PM
New window in Excel does not display default settings golden_dollars Excel Discussion (Misc queries) 0 September 28th 06 10:57 PM
How do I display text in a (popup) window? Rick[_19_] Excel Programming 2 January 6th 04 01:51 PM
Changing Excel Icon in the Active Window Aaron[_6_] Excel Programming 3 August 7th 03 09:30 AM


All times are GMT +1. The time now is 06:44 AM.

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"