Brijesh Mishra
Brijesh Mishra

Reputation: 2748

VSTO Ribbon and XLA Addin

I have created a ribbon control using VSTO, and want to call function in xla on click of button, would like to know 1> how can I call xla function from ribbon created in VSTO 2> How can I install xla plugin along with ribbon installation

Upvotes: 1

Views: 804

Answers (1)

Brijesh Mishra
Brijesh Mishra

Reputation: 2748

here is how I did it

        var macroFilePath = Path.Combine(addinPath, addinName);
        var addins = Globals.ThisAddIn.Application.AddIns.Add(macroFilePath);

        if (!addins.Installed)
        {
            addins.Installed = true;                  
        }
        var app = Globals.ThisAddIn.Application;

        string macroToInvoke = string.Format("{0}!{1}", LibraryName, FunctionName);
        Globals.ThisAddIn.Application.Run(macroToInvoke);

Upvotes: 1

Related Questions