I have written this code, but it starts having an error at the first 'SolverOk' line. Not sure how to solve and any suggestions would be appreciated!
Worksheets("Reconciliation").Activate
Range("AM3").Select
Do Until IsEmpty(ActiveCell)
ActiveCell.Offset(0, 1).Range("A1:G1").Select
Selection.ClearContents
SolverReset
SolverOk SetCell:=ActiveCell.Select, MaxMinVal:=3, ValueOf:=0, ByChange:=Range(ActiveCell.Offset(0, 1).Range("A1:G1").Select), _
Engine:=2, EngineDesc:="Simplex LP"
SolverAdd CellRef:=Range("AN" & (ActiveCell.Row)).Select, Relation:=5, FormulaText:="binary"
SolverAdd CellRef:=Range("AO" & (ActiveCell.Row)).Select, Relation:=5, FormulaText:="binary"
SolverAdd CellRef:=Range("AP" & (ActiveCell.Row)).Select, Relation:=5, FormulaText:="binary"
SolverAdd CellRef:=Range("AQ" & (ActiveCell.Row)).Select, Relation:=5, FormulaText:="binary"
SolverAdd CellRef:=Range("AR" & (ActiveCell.Row)).Select, Relation:=5, FormulaText:="binary"
SolverAdd CellRef:=Range("AS" & (ActiveCell.Row)).Select, Relation:=5, FormulaText:="binary"
SolverAdd CellRef:=Range("AT" & (ActiveCell.Row)).Select, Relation:=5, FormulaText:="binary"
SolverAdd CellRef:=Range("AQ" & (ActiveCell.Row)).Select, Relation:=1, FormulaText:=Range("AN" & (ActiveCell.Row)).Select
SolverOk SetCell:=ActiveCell.Select, MaxMinVal:=3, ValueOf:=0, ByChange:=Range(ActiveCell.Offset(0, 1).Range("A1:G1").Select), _
Engine:=2, EngineDesc:="Simplex LP"
SolverOk SetCell:=ActiveCell.Select, MaxMinVal:=3, ValueOf:=0, ByChange:=Range(ActiveCell.Offset(0, 1).Range("A1:G1").Select), _
Engine:=2, EngineDesc:="Simplex LP"
SolverSolve
ActiveCell.Offset(1, 0).Activate
Loop