0:00
Welcome! This video is part of my series on creating Excel add-ins
0:04
In the previous video, I used an icon from Excel's built-in gallery for my add-in button
0:09
In this video, I'll teach you how to use your own images as icons for your Excel add-ins buttons
0:14
Before continuing, I recommend watching the previous video for a better understanding of
0:18
the steps. The link is on the screen and in the description below
0:22
First, deactivate the add-in and navigate to the add-in folder. Rename the add-in .xlam file by adding a .zip extension to its name to make it an archive
0:31
file. I have already described this procedure in detail in the previous video
0:35
Open the archive file and drag your image file into it. Next, find the content-types.xml file inside the archive and drag it out to the desktop
0:44
Open it in a text editor. Insert a new self-closing default tag in it
0:49
and add extension and content-type attributes. Write the values for these attributes according to your image format
0:55
For example, for a PNG file, you would write png for the extension and image
0:59
slash png for the content-type attribute. Save, close, and drag the content-types.xml
1:06
file back into the archive. Next, create a new .rels file and name it
1:11
the same as the custom UI file in the archive. For example, if your custom UI file is brainbellui.xml
1:17
you would name the new file brainbellui.xml.rels. This .rels file is a relationship XML file where
1:24
Excel will read our image info, path, and ID. Carefully assign a value to the ID attribute
1:29
and remember it. We will use this value later in the custom UI file brainbellui.xml
1:35
I'll assign grid to the ID attribute. Save and close the file
1:40
Open the underscore rels folder inside the archive and drag the brainbellui.xml.rels file
1:45
into it. Go back to the archive root, drag the brainbellui.xml file out to the desktop
1:51
open it, and delete the existing image.mso attribute and its value. Write a new image attribute and give it the value grid, which we assigned to the image in
1:59
the brainbellui.xml.rels file. Save, close, and drag this file back into the archive
2:06
overriding the existing file when prompted. Finally, close the archive.xlam file and
2:12
rename it to restore its original name. Open the Excel application, activate the add-in
2:17
go to the Home tab, and you'll see that the icon has been replaced with your own image
2:21
Thanks for watching. I hope you found this video helpful. Please like, share
2:26
and subscribe for more content