ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel solver macro (https://www.excelbanter.com/excel-programming/293908-excel-solver-macro.html)

Hannu Rantala

excel solver macro
 
Hello!

I have a problem with macro using excel solver.

VBA doesn't identify solverfunctions as function. I have a reference to
solver.xla. There is no errors, at all there is no reaction for the
functions. If I put a messagebox to sub, it appears and works well.

What is the problem?

Please help!

Frank Kabel

excel solver macro
 
Hi
you may post the code you're currtnly using and which does not work.
Otherwise it's quite complicated to offer some help :-)

--
Regards
Frank Kabel
Frankfurt, Germany


Hannu Rantala wrote:
Hello!

I have a problem with macro using excel solver.

VBA doesn't identify solverfunctions as function. I have a reference
to solver.xla. There is no errors, at all there is no reaction for

the
functions. If I put a messagebox to sub, it appears and works well.

What is the problem?

Please help!



Hannu Rantala

excel solver macro
 
Ok!

I am using a code like this:
Sub Makro1()
SolverReset
SolverOptions AssumeNonNeg:=True
SolverOk SetCell:="B21", MaxMinVal:=3, ValueOf:="0",
ByChange:="B4,B6,B8"
SolverAdd CellRef:="B3", Relation:=2, FormulaText:="B5"
SolverAdd CellRef:="B4", Relation:=2, FormulaText:="B7"
SolverSolve
SolverFinish KeepFinal:=True
End Sub

The problem is actually in the last command SolverFinish. VBA doesn't
react on that command. I should make a macro which iterates several
values. So the text above should be repeated nine times. To tell to
solver what to do with results I should use SolverFinish and then
begin new iterative prosess. If I put msgbox after SolverSolve, it
appear after solverresults-window. And sometimes VBA doesn't identify
any solverfunctions but others it identify allways.

Hannu Rantala


Hi
you may post the code you're currtnly using and which does not work.
Otherwise it's quite complicated to offer some help :-)

--
Regards
Frank Kabel
Frankfurt, Germany


Hannu Rantala wrote:
Hello!

I have a problem with macro using excel solver.

VBA doesn't identify solverfunctions as function. I have a reference
to solver.xla. There is no errors, at all there is no reaction for

the
functions. If I put a messagebox to sub, it appears and works well.

What is the problem?

Please help!



All times are GMT +1. The time now is 07:37 PM.

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