求解器:发生意外的内部错误,或者可用内存耗尽

我正尝试使用VBA中的Excel解算器,但遇到了麻烦。 我不断收到以下错误:“求解器:发生意外的内部错误,或可用内存已耗尽。

现在,我想解决scheme不是内存不足,因为我可以解决同样的问题,当使用求解器对话框。

这是我的代码:

Sub CoolSolverButton() SolverReset SolverOK setCell:=Range("$CK$203"), MaxMinVal:=1, ByChange:=Range("$BH$203:$BQ$222"), Engine:=2, EngineDesc:="Simplex LP" SolverAdd CellRef:=Range("$BH$203:$BQ$222"), relation:=5, FormulaText:="binary" SolverAdd CellRef:=Range("$BH$223:$BQ$223"), relation:=1, FormulaText:=Range("$BH$225:$BQ$225") SolverAdd CellRef:=Range("$BH$227:$BH$245"), relation:=1, FormulaText:=Range("$BI$227:$BI$245") SolverAdd CellRef:=Range("$BJ$227:$BJ$245"), relation:=1, FormulaText:=Range("$BK$227:$BK$245") SolverAdd CellRef:=Range("$BL$227:$BL$245"), relation:=1, FormulaText:=Range("$BM$227:$BM$245") SolverAdd CellRef:=Range("$BN$227:$BN$245"), relation:=1, FormulaText:=Range("$BO$227:$BO$245") SolverAdd CellRef:=Range("$BP$227:$BP$245"), relation:=1, FormulaText:=Range("$BQ$227:$BQ$245") SolverAdd CellRef:=Range("$BR$203:$BR$222"), relation:=2, FormulaText:=Range("$BT$203:$BT$222") SolverAdd CellRef:=Range("$BU$203:$BU$222"), relation:=2, FormulaText:=Range("$BW$203:$BW$222") SolverSolve UserFinish:=True SolverFinish KeepFinal:=1 End Sub 

有任何想法吗?

谢谢!