Suppress prompt upon installing an addin programatically

X

XP

Using Office 2007 and Windows XP.

I built the following function that can be called to install or uninstall an
add-in on the fly. It works fine, the only problem is, when installing, XL
prompts "Copy <filename> to the addins folder?" In this case, the answer
should always be "No" and I do not want this prompt to appear to users when
this program is triggered.

Please note that I have already tried Application.DisplayAlerts = False but
this does not work. Am I reduced to SendKeys (shudder) at this point or can
someone please post example code to fix this?

Private Function AddInInstall(argInstall As Boolean, Optional argFullName As
String, Optional argBaseName As String)
If argInstall = True Then Application.AddIns.Add Filename:=argFullName
Application.AddIns(argBaseName).Installed = argInstall
End Function
 
X

XP

Sorry, I found it just now; there is an additional argument:

Application.AddIns.Add Filename:=argFullName, CopyFile:=False

Thanks to all who looked at this post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top