Solver32.dll missing

D

David Adamson

Greetings,

I developed a set of solver equations and used the follwoing code to fire
them up for re-analysis.

I set all the values using solver itself in the worksheets and was just
using the code to reactivate the equations after I changes some data.

However after I ran the code and I wanted to double check a couple of
things. So when trying to view the solver equation in the worksheet I
recived a messge that effectively said "Solver32.dll is missing and its
needs to be reinstalled via the CD"

I was wondering if this was caused by my poor coding ability when trying to
set a reference and if so how can I advoid this. As the code appears to
still work yet I can't get it to fire manually when I'm in a spreadsheet.

thanks is advance

The code used is



Private Sub RunModel_Click()
Dim x As Integer
Dim Catch As String
Dim wb As Workbook

MsgBox "Updating Catchment Data"
Call Load_Catch_Data
MsgBox "Finished Updating"

On Error Resume Next ' Adapted from Dana DeLouise's article
' Set a Reference to the workbook that will hold Solver
Set wb = ActiveWorkbook

With wb.VBProject.References
.Remove .Item("SOLVER")
End With

With AddIns("Solver Add-In")
.Installed = False
.Installed = True
wb.VBProject.References.AddFromFile .FullName
End With

MsgBox "Running solver. Please wait"

For x = 1 To 20

Catch = "Catch" & x

With Worksheets(Catch)
..Activate
solverok
solversolve userfinish:=True
solverfinish keepfinal:=1
End With
Next x

MsgBox "Finished running solver. Heading to results"

End sub
 
K

Kristoffer Tveit

If you use solver directly from excel the solver32.dll file is certanly not
missing in you system.

To call it programmatically from VBA you need to have a reference to the
file (which is not set by default).

In VBA select the "tools" ->"references" menu and activate the reference to
solver. If it is not in the list browse your way to somthing like
.....\program files\Microsoft Office\Office\Library\Solver\Solver32.dll

regard
Kristoffer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top