How to replace Taskbar icon for Excel

Following the following API method:
http://stackoverflow.com/questions/20142765/how-to-change-the-excel-icon-in-taskbar-while-loading
I wrote the following, and called the setTaskBar_Icon procedure from ThisDocument.Workbook_Open():

When I ran the sub with  NewIco = ExtractIcon32(0, myIcoFile, index) with index set between 0 and 8
I got no error reports, and displayed NO change in the classic excel taskbar icon.
Please can you advise?

Option Explicit

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

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

Sub setTaskBar_Icon()
    Dim myIcoFile As String
    Dim NewIco

    '~~> Change this to the relevant icon file
    myIcoFile = "D:\aaThink_Build\Icons_Think\Cineris_Document_Manager\Cineris_Doc_Manager_TaskBar_xlIcon.ico"

    NewIco = ExtractIcon32(0, myIcoFile, 0) '<<<<<

    SendMessage32 GetActiveWindow32(), &H80, 1, NewIco
    MsgBox "Hello" 'to check the sub had run fully
End Sub

Source of Cineris_Doc_Manager_TaskBar_xlIcon.ico
.ICO FILE: this file type does not load into EE site, so I changed the extension. If you down load it, please change it back to .ico

Thanks
Kelvin
Cineris-Doc-Manager-TaskBar-xlIcon---Cop
Kelvin4Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
It works for me as advertised, with Win7 and XL2007. What versions are you running?
Wayne Taylor (webtubbs)Commented:
Also, there is only one icon in that ICO file. So any value other that 0 will return nothing.
Kelvin4Author Commented:
Thanks:
I use excel 2010 and windows 7
When I downloaded the mislabelled ico file and replaced the file name with Cineris-Doc-Manager-TaskBar-xlIcon.ico, and opened in Windows photo viewer I got 8 pages with different icons.

I'm new to icon files, can you tell me: what am I doing wrong?

Kelvin
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Wayne Taylor (webtubbs)Commented:
I don't know about the 8 images in Photo viewer, but when you run this....

   
NewIco = ExtractIcon32(0, myIcoFile, -1)

Open in new window


...NewIco returns 1, which is the count of individual icons in the file. See here for info on the ExtractIcon function.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kelvin4Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for Kelvin4's comment #a40882032

for the following reason:

Many thanks,
I checked the attached graphics file, by downloading it and changing its name to:
Cineris_Doc_Manager_TaskBar_xlIcon.ico (this name being represented as a string by myIcoFile)

I confirm your observation that NewIco = ExtractIcon32(0, myIcoFile, -1) returns a value of 1

I confirm my observation that when Cineris_Doc_Manager_TaskBar_xlIcon.ico is opened in Windows photo viewer I got 8 pages with different icons.

I have written for guidance to IcoFx (who make the Icon graphics package).

Many thanks for helping me forward.

Kelvin
Kelvin4Author Commented:
OBJECTION ......... by Kelvin
Total embarrassment!!
I did NOT intend to Claim points for myself!!!!

Please credit  Wayne Taylor (webtubbs) with all 500 points.

Abjectly,
Kelvin
Kelvin4Author Commented:
Thanks, now I can get my points to you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.