Go Back   TechArena Community > Software > Customize Desktop
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Change the icon of an Excel file

Customize Desktop


Reply
 
Thread Tools Search this Thread
  #1  
Old 08-04-2009
Member
 
Join Date: Feb 2008
Posts: 2,180
Change the icon of an Excel file
  

I want to change the icon of a single excel file. I searched in the file properties but there is no change icon.

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

Reply With Quote
  #2  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 508
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.
Reply With Quote
  #3  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 979
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'
Reply With Quote
  #4  
Old 08-04-2009
Member
 
Join Date: Feb 2008
Posts: 2,180
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
Reply With Quote
  #5  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 2,283
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
Reply With Quote
  #6  
Old 13-10-2010
Member
 
Join Date: Oct 2010
Posts: 1
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
Reply With Quote
Reply

  TechArena Community > Software > Customize Desktop
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 05:55 PM.