Loading Libraries to Excel Through Windows Form C# -


this first question , i'm horribly scared answer on other post. i've searched hours , can't head around it.

so here's thing.

i'm working on windows form that, simplistically, has open workbooks , run macros inside these workbooks.

the macros in these workbooks use functions not belong standard excel libraries. work in bank , have proprietary functions , add-ins loaded every time open exe files.

i can launch excel application through:

microsoft.office.interop.excel.application xlapp =              new microsoft.office.interop.excel.application(); 

but calls normal excel. how can add libraries need in specific instance of excel?

the alternative solution launch excel libraries manually, using system.diagnostics.process.start("cmd.exe","my fancy excel");

but takes huge amount of time, new instance has created each workbook.

any thoughts or clarifications needed?

thank time, hope clear enough!

when starting excel through automation, won't load add-ins. have explicitly load add-ins using:

  • application.registerxll (for .xll add-ins), or
  • addins.add / addin.installed = true (for .xla or .xlam add-ins).

here older question on topic: loading addins when excel instantiated programmatically, , related msdn blog post: http://blogs.msdn.com/b/accelerating_things/archive/2010/09/16/loading-excel-add-ins-at-runtime.aspx , microsoft support article: https://support.microsoft.com/en-us/kb/213489.


Comments