简体   繁体   中英

VSTO Ribbon and XLA Addin

我已经使用VSTO创建了功能区控件,并且想在单击按钮时在xla中调用函数,想知道1>如何从在VSTO中创建的功能区中调用xla函数2>如何与功能区安装一起安装xla插件

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM