Solved

Install Excel Add-in Using VBS

Posted on 2010-09-15
2
1,453 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

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
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

635 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