Solved

Install Excel Add-in Using VBS

Posted on 2010-09-15
2
1,204 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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now