문제

I can use SolverDelete to delete a constraint if I know exactly what it looks like.

How can I delete all constraints with VBA without knowing them?

도움이 되었습니까?

해결책

You can use the SolverGet Function.

SolverGet(TypeNum, SheetName)

TypeNum is a required Integer. A number specifying the type of information you want. The following settings are specified in the Solver Parameters dialog box.

The TypeNum parameters you need are:

5, The number of constraints.
6, An array of the left sides of the constraints, in text form.
7, An array of numbers corresponding to the relationships between the left and right sides of the constraints: 1 represents <=, 2 represents =, 3 represents >=, 4 represents int, and 5 represents bin.
8, An array of the right sides of the constraints, in text form.

See Excel Help on SolverGet for more details.

다른 팁

SolverReset works if you don´t know all the parameters.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top