Thread: Addin Install
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Addin Install

Check if the addin is currently installed. If it is then uninstall it and
delete it. You can then add your new addin version back with no problems (I
assume you are re-versioning the addin?)...
--
HTH...

Jim Thomlinson


"tjh" wrote:

Yesterday you helped me to determine how to install an add-in through vba,
thank you for that.

Now I am trying to get past the alert boxes which ask if I would like to
overwrite the add-in if it currently exists. The two messages I get a
"Copy XXXX.xla to the add-ins folder?" (Yes/No/Cancel), and "A file named
XXXX.xla already exists. Do you want to replace it?" (Yes/No/Cancel).

Is there a way to program the code not to ask these questions? It will not
work if I set Application.DisplayAlerts = False because it defaults to
answering "No." Or at least the way I have it running. How can I correct the
code to answer "Yes," but not display the alerts? Below is an example of what
I am currently using.

Thank You,

Sub AdinInstall1A()

Application.DisplayAlerts = False

On Error Resume Next
Application.AddIns.Add Filename:="C:\XXXX.xla"
Application.AddIns("XXXX").Installed = True

Application.DisplayAlerts = True

End Sub