Guten Morgen zusammen,
ich erhalte auf meinem Rechner für diesen Code, die Fehlermeldung, dass ein unerwarteter Fehler auftritt. Das der Arbeitsspeicher nicht ausreicht, halte ich für eher eine gewagte These (GB64 und keine offenen Operationen).
Auf dem Laptop läuft der Code.
Hat einer von euch eine Idee, die GPT und die anderen Foren, die ich durchsucht habe, bislang nicht hatten?
Sub Optimize()
SolverReset
SolverOptions Precision:=0.00001
SolverOK MaxMinVal:=1 'Max 1 / Min 2 / Target 3
SolverOK SetCell:=Range("L18") 'target
SolverOK Engine:=1 '1 GRG Nonlinear / 2 Simplex LP / 3 EA
SolverOK ByChange:=Range("K8:K17") 'Variable
'substitute FormulaText:=Range("??") -> FormulaText:="="&Range("??")
'Weight 1 <= / 2 = / 3 >= / Integer / 5 Binary
SolverAdd CellRef:=Range("K8"), relation:=1, FormulaText:="=" & Range("Q8") 'E
SolverAdd CellRef:=Range("K8"), relation:=3, FormulaText:="=" & Range("P8")
SolverAdd CellRef:=Range("K9"), relation:=1, FormulaText:="=" & Range("Q9") 'Go
SolverAdd CellRef:=Range("K9"), relation:=3, FormulaText:="=" & Range("P9")
SolverAdd CellRef:=Range("K10"), relation:=1, FormulaText:="=" & Range("Q10") 'P
SolverAdd CellRef:=Range("K10"), relation:=3, FormulaText:="=" & Range("P10")
SolverAdd CellRef:=Range("K11"), relation:=1, FormulaText:="=" & Range("Q11") 'RE
SolverAdd CellRef:=Range("K11"), relation:=3, FormulaText:="=" & Range("P11")
SolverAdd CellRef:=Range("K12"), relation:=1, FormulaText:="=" & Range("Q12") 'Liquid
SolverAdd CellRef:=Range("K12"), relation:=3, FormulaText:="=" & Range("P12")
SolverAdd CellRef:=Range("K13"), relation:=1, FormulaText:="=" & Range("Q13") 'Com
SolverAdd CellRef:=Range("K13"), relation:=3, FormulaText:="=" & Range("P13")
SolverAdd CellRef:=Range("K14"), relation:=1, FormulaText:="=" & Range("Q14") 'I
SolverAdd CellRef:=Range("K14"), relation:=3, FormulaText:="=" & Range("P14")
SolverAdd CellRef:=Range("K15"), relation:=1, FormulaText:="=" & Range("Q15") 'H/P&D
SolverAdd CellRef:=Range("K15"), relation:=3, FormulaText:="=" & Range("P15")
SolverAdd CellRef:=Range("K16"), relation:=1, FormulaText:="=" & Range("Q16") 'Linker
SolverAdd CellRef:=Range("K16"), relation:=3, FormulaText:="=" & Range("P16")
SolverAdd CellRef:=Range("K17"), relation:=1, FormulaText:="=" & Range("Q17") 'Global
SolverAdd CellRef:=Range("K17"), relation:=3, FormulaText:="=" & Range("P17")
'Global Restr.
SolverAdd CellRef:=Range("K33"), relation:=2, FormulaText:="=" & Range("L33") ' volume
SolverAdd CellRef:=Range("K43"), relation:=1, FormulaText:="=" & Range("L34") ' risk
'SolverAdd CellRef:=Range("K35"), relation:=3, FormulaText:="=" &Range("L35") 'only Min Var Opti
SolverAdd CellRef:=Range("K36"), relation:=1, FormulaText:="=" & Range("L36") ' H, P, D max. volume
SolverAdd CellRef:=Range("K37"), relation:=1, FormulaText:="=" & Range("L37") ' volume
SolverAdd CellRef:=Range("K38"), relation:=1, FormulaText:="=" & Range("L38") ' volume + infra
SolverAdd CellRef:=Range("K41"), relation:=1, FormulaText:="=" & Range("L41") ' max SD allowed
SolverSolve
'userfinish=true -> MC Simulation
Cells(3, 10).Value = CDate(Format(Now, "dd.mm.yy hh:mm"))
End Sub
Besten Dank für eure Mühe
Pat