[proud sponsor] Changing add-in ProgID

49 views
Skip to first unread message

Adrian Moisii

unread,
Feb 24, 2023, 4:45:18 AM2/24/23
to Excel-DNA
Hello Govert,
I need to get the ProgId of my add-in, in order to use it in an Office add-in (JavaScript) integration.
I found this related thread and also this one, but I can't manage to change the default  ProgId. In the latter thread you mentioned that "You can also explicitly assign a ProgId to the ExcelRibbon-derived class by adding a [ProgId] attribute.", so I added this in my Ribbon.cs class, but the ProgId of the add-in is still something like Dna_aefbdbccaabe5606af7aa74ef099df4f_0 (I'm getting the ProgId through some VBA code).

namespace ArtemisSheets
{
    [ComVisible(true)]
    [ProgId("MyAddin.ExcelAddIn")]
    public class Ribbon : ExcelRibbon
    {

Questions:
1. Can the ProgId be customized?
2. You mentioned that "The default ProgId is the FullName of the class (namespace.typename).", so it shouldn't change as long as the namespace remains unchanged. In this case, I guess I can use the default ProgId, right? It would be great to be able to customize it though.

Govert van Drimmelen

unread,
Feb 24, 2023, 2:26:24 PM2/24/23
to exce...@googlegroups.com

Hi Adrian,

 

Thank you for contributing to the project by signing up to Sponsor @Excel-DNA on GitHub Sponsors !

 

For the custom ProgId on the Ribbon class to work, you need both a ProgId attribute, and a Guid attribute where you allocate a unique Guid for your Ribbon add-in.

If you both, it should work as you expect.

 

    [ComVisible(true)]
    [ProgId("MyAddin.ExcelAddIn")]

    [Guid(…..)]
    public class Ribbon : ExcelRibbon
    {

    }

Please write back if that doesn’t work.

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/5909cdb6-ce29-4ce5-860e-be0176b8d55cn%40googlegroups.com.

Message has been deleted
Message has been deleted

Adrian Moisii

unread,
Feb 25, 2023, 3:38:42 AM2/25/23
to Excel-DNA
ProgId + Guid = love! Thanks a lot!

Keep up the good work, we are here to support you!

Adrian
Reply all
Reply to author
Forward
0 new messages