ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hot to change the Excel File Logo (VBA Project) (https://www.excelbanter.com/excel-programming/414148-hot-change-excel-file-logo-vba-project.html)

Shazi

Hot to change the Excel File Logo (VBA Project)
 

Hi,

I made a vba project, and I want to change the Excel File Logo (Excel
File Icon). to give a professional look of my vba program.

How it is possible.....

If any one knows pls send me reply.

Regards.

Shahzad

Shazi

Hot to change the Excel File Logo (VBA Project)
 
On Jul 16, 1:42*pm, Shazi wrote:
Hi,

I made a vba project, and I want to change the Excel File Logo (Excel
File Icon). to give a professional look of my vba program.

How it is possible.....

If any one knows pls send me reply.

Regards.

Shahzad



I find the below procedure on the web, but its not working, pls
check what is the mistake, if any one knows.

*****************

This code shows you how to change the Excel icon:

Declare Function GetActiveWindow32 Lib "USER32" Alias _
"GetActiveWindow" () As Integer

Declare Function SendMessage32 Lib "USER32" Alias _
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long

Declare Function ExtractIcon32 Lib "SHELL32.DLL" Alias _
"ExtractIconA" (ByVal hInst As Long, _
ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long

Sub ChangeXLIcon()
Dim h32NewIcon As Long
Dim h32WndXLMAIN As Long
h32NewIcon = ExtractIcon32(0, "Notepad.exe", 0)
h32WndXLMAIN = GetActiveWindow32()
SendMessage32 h32WndXLMAIN, &H80, 1, h32NewIcon 'Icon big
SendMessage32 h32WndXLMAIN, &H80, 0, h32NewIcon 'Icon small
End Sub

************


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com