Where is the Excel add-in saved by programmatically adding and installing?

I am trying to automate the addition and installation of an add-in for Excel, where the add-in is on a shared network drive. I know from my reading on the Internet ( here and here ) that I need to make a copy that is read-only on a shared network drive. And thanks to the first link, I now know how I can make changes, corrections and additions to my add-in on the way using this method of storing a file on a shared network drive.

Now, having an idea of ​​this process, I began to learn how to automate adding and installing add-ons after that on a shared network drive. I stumbled upon this post that pointed me in the right direction to using the Excel.AddIn object. So, I spent some time looking at the msdn documentation on the AddIn Object properties ( Installed property and AddIn Object ), where I found this bit of code that adds and installs the add-in on one line

 AddIns.Add("generic.xll").Installed = True 

My question (and concern) :

In the instructions below

Instructions

Fifth point fifth bothers me a bit, because I could not find out how I can get it on the Internet, if I use the above code fragment to add and install an add-in, copy it to a local / user folder (which I don’t want), save it in shared network folder or if it will ask the user in the same way as when manually browsing to add an add-in. If he tells them, is there a way to choose for them (always press β€œNo”) or is there a way to choose β€œNo” without showing them a hint at all? How can I use the code above and make sure that it adds and installs the add-in file on this shared network drive? Can anyone shed some light on this situation for me?

+5
source share
1 answer

Great question. What you are looking for is the CopyFile argument of the Addins.Add method. Setting it to false matches the answer "No" to "Copy to local folder?". tell me:

enter image description here

And just to clarify what you already know, the Addin.Installed property simply determines whether the add will be selected in the Addins dialog box. (It is not very clear to me when I first came across it).

+4
source

Source: https://habr.com/ru/post/1243544/


All Articles