开发者

VSTO Ribbon and XLA Addin

开发者 https://www.devze.com 2023-03-23 23:39 出处:网络
I have created a ribbon control using VSTO, and want to call function in xla on click of button, would like to know

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开发者_JAVA百科 created in VSTO 2> How can I install xla plugin along with ribbon installation


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消