Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Install Excel Add-in Using VBS

Posted on 2010-09-15
2
Medium Priority
?
1,704 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:jonathan_hills
2 Comments
 
LVL 13

Accepted Solution

by:
MWGainesJR earned 2000 total points
ID: 33682824
Can you just copy the xla to the xlstart folder? "C:\Program Files\Microsoft Office\Office10\xlStart
0
 

Author Comment

by:jonathan_hills
ID: 33684007
Okay thank you. For clarification if anybody else if having issues with this, for actually installing the add-in from VBScript, you use something like this.

'''open Excel
Set xlApp = CreateObject("excel.application")

xlApp.Visible = False

With xlApp
   .Workbooks.Add
   .Application.Addins.Add(.Application.TemplatesPath & "PTSREPORTS.xla").Installed = True
   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.WriteVersionToRegistry

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"
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question