|
| ||||||||||
| Tags: change, excel, file, icon |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Change the icon of an Excel file
The goal is to have different icons in relation to the types of Excel files for further clarity. The icons used are free, meaning that I can use what I draw If you have any info to help me I'm interested |
|
#2
| ||||
| ||||
| Re: Change the icon of an Excel file
To my knowledge what you want to do is not feasible because the icon is linked to the type of file and not in his name. A possible solution, create a folder and add a shortcut for each file, then each shortcut will be individually adjustable. |
|
#3
| ||||
| ||||
| Re: Change the icon of an Excel file
1 - Create a desktop shortcut to your file (Right Click/new/shortcut). 2 - Right click on the shortcut then 'Properties' then 'change icon' |
|
#4
| ||||
| ||||
| Re: Change the icon of an Excel file
the solution of the shortcut is not what I wanted (this is what I already use). It does not totally agree, is there any other solution |
|
#5
| ||||
| ||||
| Re: Change the icon of an Excel file
You can test this procedure to place the module in the workbook "ThisWorkbook". Code: Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessageA Lib "user32" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Long) As Long
Private Declare Function ExtractIconA Lib "shell32.dll" _
(ByVal hInst As Long, ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long
Private Sub Workbook_Activate ()
Dim File As String
Dim x As Long
'Path and filename of the icon to display
File = "C:\folder\myfile.ico"
'Check if file exists
If Dir (File) = "" Then Exit Sub
x = ExtractIconA (0, file, 0)
SendMessageA FindWindow (vbNullString, Application. Caption), _
& H80, False, x
End Sub
Private Sub Workbook_Deactivate ()
Dim File As String
Dim x As Long
File = Application. Path & "\excel.exe"
x = ExtractIconA (0, file, 0)
SendMessageA FindWindow (vbNullString, Application. Caption), _
& H80, False, x
End Sub |
|
#6
| |||
| |||
| Re: Change the icon of an Excel file
Hi everybody, I've been using this tempalte for a while and runs properly. However I've been asked to be a little bit more 'seasonal' in my excel files and suggest me to put a pumpkin icon & 'Happy Halloween' for example. I can uplaod an icon from internet put it in C:\WINDOWS\system32 and that's it. However when my friends will open the file it will work only if they also have the .ico file. Is there a way to self contain the picture into the excel file ? Something like refering to the picture paste somewhere on the excel file or keep in a UserForm in vba? Thansk for your answers. Don Pablo |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Change the icon of an Excel file" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change Numbering On/Off icon change from Roman numbers in OpenOffice? | Super-Man | Windows Software | 4 | 19-02-2012 03:58 PM |
| How to change the icon of a .bat file in Windows 7? | Hima!! | Windows Software | 6 | 05-10-2011 01:15 AM |
| How to change icon or folder icon in Android | Tana$ya | Portable Devices | 6 | 06-07-2011 10:35 AM |
| How to Change Icon of the Batch File? | Segvoia | Operating Systems | 3 | 20-11-2009 09:36 AM |
| Unable to access linked Excel file from shared Excel file on server | AK_Chopra | Windows Software | 4 | 07-05-2009 02:09 PM |