troubleshooting Question

Loading the Appropriate Excel Add-In from either 2003 or 2007 (xla or xlam)

Avatar of PeterWhitts
PeterWhittsFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft OfficeMicrosoft Excel
13 Comments1 Solution1391 ViewsLast Modified:
I have a workbook which is saved as a 2003 type but is used by version 2007.
I have the Add-in "Analysis ToolPak - VBA" installed on the 2003 but when I run my code in 2007 it cannot find the project library atpvbaen.xla In the VBA reference it is MISSING.

If I untick and tick the 2007 AddIn I then get MISSING  atpvbaen.xlam when running the code back in the 2003 version.

Is it possible to run some code on the workbook open event similar to that below to install the appropriate AddIn for the excel version running.

Many thanks
If Application.Version < 12 Then
AddIns("atpvbaen.xla").Installed = True
AddIns("atpvbaen.xlam").Installed = False
Else
AddIns("atpvbaen.xla").Installed = False
AddIns("atpvbaen.xlam").Installed = True
End If
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 13 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros