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);
精彩评论