Solver.xla added-in; VB references wants Solver.XLAM ???

Focus
05-25-2010, 02:45 AM
I am using Excel 2003. A macro in a spreadsheet I received from another party crashes on the macro line: "Solver OK "Can't find project or library."

I have already added the Solver add-in, through Excel, and it is Solver.XLA, in my Office 11 folder.

In VB|Tools|References there is a checked box saying: "Missing: Solver.XLAM". The macros in the spreadsheet however specify only Solver.XLA, or just plain Solver on some lines. There is no check box anywhere in the list for Solver.XLA.

I am mystified as to why VB is looking for an .XLAM file, when what I have installed is an .XLA file, and since an .XLAM file is not specified in the macros.

How can I get a copy of Solver.XLAM? Or how can I fix the problem in some other way?

-Thx.

Flyguy
05-25-2010, 03:36 AM
Is XLAM not the Excel 2007 variant of a XLA file?
In other words, maybe the macro will only work on Excel 2007 and up.

Colin Legg
05-25-2010, 03:49 AM
Yep, one of the issues with early binding.

You'll need to untick the MISSING reference and add a reference to SOLVER (xla).

The code can also be re-written using Application.Run to avoid this issue - there's a great article on Jon Peltier's site:
http://peltiertech.com/Excel/SolverVBA.html

(see the "Avoiding Solver Reference Problems" section)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum