![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: John G
Posts: 62
|
Is it possible to change the icon of an excel .xls file? If so how would I go about doing this. Is this something that can be done with maunually without vba or only in vba or not at all?
John |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Stockton, California
Posts: 281
|
im not 100% sure, but i would think this is a windows thing. it uses the icon for the program it is associated with. so if you told windows to open .xls files with wordpad, they would have wordpad icons. Im not sure if it is possible to change them. You can change the shortcuts to them however!
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Yes you can change the icon
try this simplified version; Note it gets the icons from the more icons dll BUT you can get it from anyprogram.... '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 Dim hdlNewIcon As Long Dim hdlXlMain As Long Sub ChangeXLIcon() hdlNewIcon = ExtractIcon32(0, "C:WINDOWSMoricons.dll", 1) hdlXlMain = GetActiveWindow32() SendMessage32 hdlXlMain, &H80, 1, hdlNewIcon 'Icon big End Sub Sub RestoreXLIcon() hdlNewIcon = ExtractIcon32(0, "C:Program FilesMicrosoft OfficeOfficeexel.exe", 1) hdlXlMain = GetActiveWindow32() SendMessage32 hdlXlMain, &H80, 1, hdlNewIcon 'Icon big End Sub HTH Ivan |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Posts: 50
|
Right click on the icon
Select Properties Click on the Change icon button. Browse to find a suitable icon There are lots in moreicon.dll You can get programs to create your own. Try searching TUCOWS |
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Posts: 32
|
Won't all these procedures make every single .xls file have that icon? That has been my experience in the past.
If the goal is to only change the icon of one file, then this is a problem. |
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
clsoing excel down resets back to original Where as the manual method will not. Ivan |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|