Can you save add-ins information in a spreadsheet?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet that requires the 'Analysis ToolPak' add-in to be
enabled. When I send the spreadsheet to other people, they often don't read
the instructions to enable this add-in and they get errors in the
spreadsheet. Even those that realize the cause of the errors sometimes have
to enable and disbale the add-in a few times before things start working. Is
there a way for the add-in to be enabled automatically when the spreadsheet
is opened?
 
Insert a Module and copy this code:
Sub Auto_Open()
AddIns("Analysis ToolPak").Installed = True
AddIns("Analysis ToolPak - VBA").Installed = True
End Sub
 
You can include a workbook_open code that loads the ATP when the users open the
file......with macros enabled, of course.

Private Sub Workbook_Open()
AddIns("Analysis ToolPak").Installed = True
End Sub

To insert this, right-click on the Excel Icon at top left of Menubar and select
"View Code".

Copy/paste the code into that module.


Gord Dibben MS Excel MVP
 
Hi Gord, I have an addin that i need to have run everytime
(automatically) a user opens Excel 2003. The addins reside in a
directory structure off of C: (C:\HYPERION\essbase\bin - I do not
believe that they can be copied to the XLSTART directory as there are
other files in the bin directory). There are an xll & an xla file in
the directory, but it looks like if you manually add only the xll file
in Excel using the AddIn menu item, it loads the addin properly.
However, if I place a shortcut to the xll file in the XLSTART
directory, it doesn't appear to load the addin. If I place a shortcut
to the xll & xla files in the XLSTART directory, it does appear to load
the add in properly, but they do not show up in the addin list & I fear
that they are not really "installed".

I've also tried creating a shortcut using the application switch:
/LS:\HYPERION\essbase\bin\essxleqd.xla and/or
/LS:\HYPERION\essbase\bin\essexcln.xll

I did find the following code on the MS website (
http://support.microsoft.com/default.aspx?scid=kb;en-us;280290 ) (which
I have edited), but I am pretty ignorant of how to implement it or use
it. I did try using the instructions you've place here, but I must not
be doing something right because I cannot get it to work.

Are you able to assist with this type of problem? thnx!!
 
I don't understand why you are trying to create a shortcut or why you are
wanting to copy any files to your XLSTART folder.

I do know that you have changed the rules in mid-stream.

Your original post asked how to enable the Analysis Toolpak Add-in.

Now you are asking for other add-ins to be loaded.

essxleqd.xla is not a default Excel add-in.

The workbook_open code I posted is inserted into the Thisworkbook module of the
workbook you and users are to open.

Try adding the name of your add-in to the workbook_open code.


Gord
 
Thanks Gord, It all works a treat !!

Gord Dibben said:
You can include a workbook_open code that loads the ATP when the users open the
file......with macros enabled, of course.

Private Sub Workbook_Open()
AddIns("Analysis ToolPak").Installed = True
End Sub

To insert this, right-click on the Excel Icon at top left of Menubar and select
"View Code".

Copy/paste the code into that module.


Gord Dibben MS Excel MVP
 
Sorry about that "changed the rules" statement.

I had not noticed that you were not the original poster.

Have you tried to load your add-in using the workbook_open code?

At one point you say the files appeared to load but did not appear in the
add-ins list.

They don't have to appear in that list to be loaded.

What happens when you enter a formula using one of the functions from your
add-in?

Hit ALT + F11 to get to VB Editor.

If your add-in is loaded you will see it there.


Gord
 
Thank you, & sorry to confuse. I am automating the installation of the
Hyperion program for a group of users and when they use Excel, they
need the Hyperion add-in to load. I have tried the various techniques
listed & seem to get limited success. The Hyperion program installs
fine, but this need to make the add-in work after the install runs is
kind of difficult to get automated post-install.

The weirdest way I've made it work is to creat 2 shortcuts, 1 to the
xll & 1 to the xla files & put them into the XLSTART fldr. I can
repackage the MSI to include those, but I would really like to be able
to do it in a cleaner, more viable manner. Possibly using the more
advanced functionality available in Excel. That is where I am needing
more help.

I'm not sure that what I did to load the add-in via the workbook open
code was the correct way to do it since it didn't work.
1. Right click on Excel icon top left corner, click View Code
2. In the middle box labled Book1 - This Workbook (Code), pasted the
following:

Dim oXL As Object, oAddin As Object
Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add("C:\HYPERION\essbase\bin\essexcln.xll",
True)
Set oAddin = oXL.AddIns.Add("C:\HYPERION\essbase\bin\essxleqd.xla",
True)
oAddin.Installed = True
oXL.Quit
Set oXL = Nothing

3. When I exit it wants to save the changes to Book1, but I'm not sure
how/why/where to save this so that it runs everytime Excel is opened,
so I tried saving it in the XLSTART fldr (I also want to make sure it's
loaded for all the spreadsheets in the workbook)

4. Reopening Excel after that didn't result in the Add-in being
loaded.

5. I also tried the same thing using this:
Private Sub Workbook_Open()
AddIns("C:\HYPERION\essbase\bin\essexcln.xll").Installed = True
AddIns("C:\HYPERION\essbase\bin\essxleqd.xla").Installed = True
End Sub

6. Saved it into XLSTART & on the relaunch of Excel, there's a MS VB
Run-time error '9': Subscript out of range, the debugger shows a
failure on the 2nd line. The AddIn isn't loaded.

at this point i'm stuck.
 
Back
Top