#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel Icon

Hi,

How to replace Excel Icon with my own icon?

Please refer to the question send by jpcmaddog. I also have this question to
ask.
Thanks for those who have answered that question but I need more...

Do any experties out there can help us (and also everybody who have the
similar
qestion to ask)?

Microsoft Access able to do this on the Start up menu... by setting the
Applicaton icon to a bitmap file or .ico file. This icon will appear on the
application... but that icon fle must also included together with the access
mdb or mde files, since it is 'link' icon file.
I wonder why this could not be done in Excel? Till now I'm still looking for
the answer!

Looking ahead for any help in this regard.

Thanks in advance,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Excel Icon

It can be done with API calls. This procedure changes both the icon
in the upper left corner of the 2003 Excel window and the icon on the
Windows XP taskbar.

' Get the handle for a window
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
' Extract an icon from a file
Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" _
(ByVal hInst As Long, ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long
' Send a Windows message
Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Long) As Long
' Windows message types
Public Const WM_SETICON = &H80

Sub changeIcon(fName$)
Dim iconFname$, a&, hWnd&, hIcon&
iconFname$ = "c:/folderwithyouriconfile" & "tnt01.ico"
' Get the icon from the source
' 0 = no icons in source, 1 = invalid icon source
hIcon& = ExtractIcon(0, iconFname$, 0)
' set the Excel application window
hWnd = FindWindow("XLMAIN", Application.Caption)
If hWnd& 0 And hIcon& 1 Then _
a& = SendMessage(hWnd&, WM_SETICON, False, hIcon&)
' set taskbar icon to small
hWnd& = FindWindow(vbNullString, fName$)
If hWnd& 0 And hIcon& 1 Then _
a& = SendMessage(hWnd&, WM_SETICON, False, hIcon&)
End Sub

Call with
changeIcon ActiveWorkbook.Name
or changeIcon Workbooks("yourworkbook").Name

Carl.

On May 7, 12:41 am, Badrul wrote:
Hi,

How to replace Excel Icon with my own icon?

Please refer to the question send by jpcmaddog. I also have this question to
ask.
Thanks for those who have answered that question but I need more...

Do any experties out there can help us (and also everybody who have the
similar
qestion to ask)?

Microsoft Access able to do this on the Start up menu... by setting the
Applicaton icon to a bitmap file or .ico file. This icon will appear on the
application... but that icon fle must also included together with the access
mdb or mde files, since it is 'link' icon file.
I wonder why this could not be done in Excel? Till now I'm still looking for
the answer!

Looking ahead for any help in this regard.

Thanks in advance,


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Icon

On Monday, May 7, 2007 6:41:01 AM UTC+1, Badrul wrote:
Hi,

How to replace Excel Icon with my own icon?

Please refer to the question send by jpcmaddog. I also have this question to
ask.
Thanks for those who have answered that question but I need more...

Do any experties out there can help us (and also everybody who have the
similar
qestion to ask)?

Microsoft Access able to do this on the Start up menu... by setting the
Applicaton icon to a bitmap file or .ico file. This icon will appear on the
application... but that icon fle must also included together with the access
mdb or mde files, since it is 'link' icon file.
I wonder why this could not be done in Excel? Till now I'm still looking for
the answer!

Looking ahead for any help in this regard.

Thanks in advance,


Sorry disturbing you but i was watching your code and i would like to know if i need to put it in a module. Also do i have to copy the whole code or break it in two parts (first one and the Sub one)? Can you help me because i've created a module and pasted all the code there and indicated the location of my icon and the name of it and nothing happens.
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
Icon Sets - Display icon in one cell depending upon value in anoth Nolene Excel Worksheet Functions 2 February 26th 10 05:43 AM
Excel Icon Kathy Excel Discussion (Misc queries) 0 January 10th 10 03:04 AM
Excel icon Michael Beckinsale Excel Programming 2 August 21st 05 08:18 PM
Excel Icon Andy Setting up and Configuration of Excel 0 March 19th 05 03:57 PM
Excel Icon nathan Excel Programming 0 August 9th 04 03:34 PM


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