jonathan_hills
asked on
Install Excel Add-in Using VBS
Hi,
I am trying to install an Excel add-in called PTSREPORTS.xla. The question is how do you install this add-in using only a vb script? FYI I am pretty clueless when it comes to vbs. The script is being called from an installer.exe I already created so I will not already have Excel open when running the script.
I am trying to install an Excel add-in called PTSREPORTS.xla. The question is how do you install this add-in using only a vb script? FYI I am pretty clueless when it comes to vbs. The script is being called from an installer.exe I already created so I will not already have Excel open when running the script.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
'''open Excel
Set xlApp = CreateObject("excel.applic
xlApp.Visible = False
With xlApp
.Workbooks.Add
.Application.Addins.Add(.A
Set a = .Application.AddIns("For Test") 'The Title - In Properties - Summary
If a.Installed = True Then
Sh.PopUp "PTSREPORTS.xla installed !",6,"Confirmation !!!",48
Else
MsgBox "Problems !?!"
End If
End With
'''exit Excel
xlApp.Quit
This is so that in your .xla file you could have the following:
Private Sub Workbook_AddinInstall()
Debug.Print "Installing PTS Reports Add-in"
InstallMainMenu
version.WriteVersionToRegi
End Sub
This code is not in working condition, but gives an idea of how too actually install the add-in.
**Instead of TemplatesPath or xlStart the default for excel is actually "C:\Documents and Settings\user\Application Data\Microsoft\AddIns"