ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Solver32.dll missing (https://www.excelbanter.com/excel-programming/318690-solver32-dll-missing.html)

David Adamson[_4_]

Solver32.dll missing
 
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



Kristoffer Tveit

Solver32.dll missing
 
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


"David Adamson" wrote:

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





All times are GMT +1. The time now is 01:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com