简体   繁体   English

Excel 2007 VBA错误#450-求解器加载项

[英]Excel 2007 VBA Error #450 - Solver Addin

I have created a macro that works perfectly in 2010 but when I try to run 2007 it pops up an error message "Run-time error '450' Wrong number of arguments or invalid property assignment'. I'm solver addin integration- I have attached the excel file - In that sheet called "Multilinesup" and the macro button is "Run Optimizer". 我创建了一个宏,该宏在2010年可以正常运行,但是当我尝试运行2007年时,它会弹出一条错误消息“运行时错误'450'参数数量错误或属性分配无效”。我是求解器插件集成-我有附加了excel文件-在名为“ Multilinesup”的工作表中,宏按钮为“ Run Optimizer”。

Please help. 请帮忙。

http://excelbyjoe.com/MEF/wp-content/uploads/2015/07/MLB-Optimal-lineups-v3-2007.xlsm http://excelbyjoe.com/MEF/wp-content/uploads/2015/07/MLB-Optimal-lineups-v3-2007.xlsm

The Problem is SolverOk code 问题是SolverOk代码

Please help 请帮忙

The SolverOK function takes four arguments in Excel 2007 and six arguments in Excel 2010 . SolverOK函数在Excel 2007中 SolverOK 四个参数, 在Excel 2010中 SolverOK 六个参数 The two additional arguments that it takes in Excel 2010 specify the solver engine. Excel 2010中需要使用的两个附加参数指定了求解器引擎。 If you remove these arguments, it should work. 如果删除这些参数,它将起作用。

An alternative way to specify the Simplex LP engine is to set SolverOptions AssumeLinear:=True . 指定Simplex LP引擎的另一种方法是设置SolverOptions AssumeLinear:=True This should work fine for both versions. 这对于两个版本都应该工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM