I am trying to figure out the directory from which the excel addin is loaded inside the addin program. Does anyone know if there is an xlcXXXXX or xlfXXXXX function by which I can do that. Or may be some other way to do it. I am programming the excel addin in c++. To clarify what I am trying to do :
say the addin (myaddin.xll) reside in C:\dir1\ and say a excel file (myexcel.xls) reside in C:\dir2.
I open myexcel.xls and then load myaddin.xll in it. Objective is to know the path (i.e. C:\dir1) from where the addin was loaded inside the addin program. Is this possible either with some windows programming way or some command within the XLCALL.h file.
Many thanks in advance.
Using the XLW library
xlw::XlfExcel::GetName() should return the name of the XLL.
You may want to look at the call back xlGetName
http://msdn.microsoft.com/en-us/library/office/bb687859%28v=office.15%29.aspx
Returns the full path and file name of the DLL in the form of a string.