How to determine where my plug-in is installed

Add-in Express™ Support Service
That's what is more important than anything else

How to determine where my plug-in is installed
aka What's My Installation Directory? 
George Spears




Posts: 70
Joined: 2010-05-06
Hello,

In standalone apps, I can run the following code to get the install directory.


ExtractFilePath(Application.ExeName);


When I run this from an Excel plugin, I get the directory where Excel is installed. How do I get the directory where my DLL plug-In has been installed?
Posted 03 Nov, 2014 07:16:21 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello George,

Please try
System.Reflection.Assembly.GetExecutingAssembly().CodeBase

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 03 Nov, 2014 07:47:14 Top
George Spears




Posts: 70
Joined: 2010-05-06
Andrei,

I am putting this in my IMPL file. What do I need in my USES clauses for this? I am getting undeclared Identifier on REFLECTION.
Posted 03 Nov, 2014 08:02:31 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
George,

My bad. Please ignore the above; it relates to .NET. In Delphi, see ExtractFilePath(GetModuleName(HInstance)).

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 03 Nov, 2014 08:10:49 Top
George Spears




Posts: 70
Joined: 2010-05-06
That did it. Thanks!
Posted 03 Nov, 2014 08:46:05 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
You are welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 03 Nov, 2014 08:53:58 Top