Search code examples
c++excelbatch-filexll

attach same addins but from different folders on Excel start up


I have a Excel addin XLL that is written in C++, say it is called abc.xll.

What I would like to do is to write a little batch script so that when I call it to start with "Prod" parameter it will launch the Excel with the xll addin in the C:\xllProduction\abc.xll folder and when I start it with the "Dev" parameter it will launch Excel xll in the C:\xllDev\abc.xll folder.

I know I can use set local in .bat file to force the environmental variable to be effective for a particular session only, and I can use start excel to start Excel, but I am not sure how to start with a particular xll.

I am using Excel 2010 if that helps.

Thanks!


Solution

  • You'll need to fix the registry entries that Excel uses to pick up XLLs in your launch script. Take a look at this answer for tips: How to deploy an Excel XLL Add-In and automatically register the Add-In in Excel