excel - How to install VBA-AddIn from VSTO and call macros -


i have *.xlam file vba-macros , vsto flexible ribbon. want install vba-addin vsto , call vba-macros, when try code macros become available after restart excel application. possible make available macros without restart?

    var addin = appexcel.addins.add(addinpath, false);      foreach (excel.addin addin in appexcel.addins)     {         if (addin.name.contains("vbalibname"))         {             addin.installed = true;         }     }      globals.thisaddin.application.run(macroname); 

i figured out, behavior caused exception. tried call code in thisaddin_startup, , application doesn't have opened workbooks. solved problem line of code before adding addin.

    excel.workbook wb = appexcel.workbooks.add(); 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -