Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
In Excel 2007, the open file window does not display the folders p | Excel Discussion (Misc queries) | |||
display program and file name at top of window in Excel | Excel Discussion (Misc queries) | |||
New window in Excel does not display default settings | Excel Discussion (Misc queries) | |||
How do I display text in a (popup) window? | Excel Programming | |||
Changing Excel Icon in the Active Window | Excel Programming |