--------------------------------------------------
Excel-DNA is now registered on GitHub Sponsors.
Your monthly contribution encourages further development and support.
--------------------------------------------------
Hi Hagai,
The LoadImage code you show is in the ExcelRibbon base class in the ExcelDna.Integration assembly.
In that old post I was just trying to explain _why_ it works to put
loadImage='LoadImage'
in the xml markup even if you don’t have such a callback in your ribbon implementation class.
It works because that callback is defined in the ExcelRibbon base class.
You can add those image files as items in your project, and then mark then as “Copy to Output Directory: Copy if newer”.
You’ll have to experiment a bit with the directories, but if you look at the build output you’ll see whether the ExcelDnaPack step is picking them up successfully.
-Govert
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/b21cfcc1-a297-45ba-bd99-999911d28ec4n%40googlegroups.com.
Hi Hagai,
For the Ribbon support you’ll have to work very carefully through the tutorial (even though it’s VB, it is my best attempt at explaining things) and also you have to look very very carefully at all the documents that are linked from: Tutorials/Fundamentals/RibbonBasics at master · Excel-DNA/Tutorials (github.com) and here: Samples/Ribbon at master · Excel-DNA/Samples (github.com)
You’ll see some of those documents explain the allowed tags for the ribbon xml, other bits explain how to set up Excel to show you UI errors, and in other parts I try particular bits like how to add an image (Tutorials/Fundamentals/RibbonBasics at master · Excel-DNA/Tutorials (github.com))
In the stuff you show, you use a tag called “img” instead of “image”. As you go through the documents and examples, you’ll see that the tags in the ribbon xml are not normal html tags, and for the image you need to say “image”.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/7d26db07-9211-4f08-a600-2791337a46can%40googlegroups.com.
You are mixing parts that need to go into two different places.
The bottom part where you have <Image … /> is not part of the xml markup for the ribbon.
It goes into your .dna file, which tells Excel-DNA to pack it into the .xll, and also for the ExcelRibbon.LoadImage implementation to find it again.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/c2b59da1-55ed-4905-9ac0-edd30436396an%40googlegroups.com.
Have you perhaps changed the method signature, from returning “Bitmap” to returning “Object”?
-Govert
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/7538e680-0d5c-47b8-8007-f10c6a75c12dn%40googlegroups.com.