ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Suppress prompt upon installing an addin programatically (https://www.excelbanter.com/excel-programming/410337-suppress-prompt-upon-installing-addin-programatically.html)

XP

Suppress prompt upon installing an addin programatically
 
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


XP

Suppress prompt upon installing an addin programatically
 

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.


"XP" wrote:

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



All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com