### Welcome to the OpenSolver on-line help.

We hope that most of your questions will be answered on the Using OpenSolver page. However, if you still have a question, please post it below.

## Building Linear Programming models

Writing optimisation models that only use linear mathematical equations and inequalities is not easy. However, most of the time you want to build these “linear programming” models (and avoid non-linear models) because these are easier and more reliable to solve using packages such as OpenSolver. (OpenSolver uses CBC by default to solve these linear programmes.) Check out this Wiki page on linear programming.

The AIMMS folks have a great online chapter describing how to take non-linear requirements (local copy of pdf) and model them using linear programming. (Thanks to Stu Mitchell of PuLP fame for pointing out this resource.) The NEOS guide is also a great resource. If you still have a modelling question (e.g., how do I express this requirement using the rules for a linear program), please ask it on https://www.or-exchange.org/.

## Common Software Problems

Excel can have problems dealing with add-ons. Visit http://www.add-ins.com/how_to_repair_office.htm for a guide on fixing these.

### 1. OpenSolver not loading – July 2016 Office update (no error message)

In July 2016, MicroSoft released an update to Office 365 which prevents OpenSolver from loading unless the .zip file is “unblocked” before the files are extracted. (We expect this change to appear in other versions of Excel.) The symptoms are simply that OpenSolver does not appear in the Data tab; there is no error message shown. To fix this, delete your old OpenSolver files (but not the downloaded .zip file), right click the downloaded OpenSolver .zip file, choose Properties, and click the Unblock button which will show if the file is blocked. Once the file is unblock, close the properties dialog, and then un-zip the files and open up OpenSolver.xlam as usual.

### 2. Unable to find the external solver …

If OpenSolver reports this problem, then it could not find a solver file that comes with OpenSolver. Please check that you have extracted (i.e. un-zipped or uncompressed) all the files from the OpenSolver download.

### 3. The solver did not create a solution file.

If this error is reported, then it is likely that OpenSolver was unable to run the solver executable. This may happen if the OpenSolver files are in an ‘untrusted’ location, and so Windows will not let them be run. First check whether the solver is shown as found in the “About OpenSolver” form. If not, go to the folder identified in the “About OpenSolver” form and double click on this solver file. You should then see a command window open that gives the solver name and version information etc. If you don’t see this, then Windows should give you an error message to help you diagnose the problem. It may help to move the OpenSolver folder (and all the files it contains) into a location such as your Documents, or even into Program Files, and try again.

### 4. Solver crashes; OpenSolver reports no solution file

The files in the “Solver” folder provided with OpenSolver contain the actual solver code. These solvers are being continually upgraded as bugs are reported and fixed. If OpenSolver reports that no solution file was generated, then the solver may have crashed. This can happen on big problems when the solver runs out of memory, but also on smaller problems that happen to hit a solver bug. In such cases, you should check if a newer version of OpenSolver is available since we regularly update the solvers included with OpenSolver as they are released.

With CBC, a typical OpenSolver error for thois problem message might be: ‘The CBC solver did not complete, but aborted with the error code -1073741510’

If needed, you can download the latest version of CBC, Bonmin or Couenne from AMPL. Download the either the Windows or Mac version as appropriate. For Windows, get the 32-bit version if you have 32-bit Windows, or the 64-bit version otherwise. (The 64 bit version will solve much larger problems than the standard 32 bit version included in OpenSolver, so always choose this if possible. Right-clicking on Computer, and choosing Properties, will tell you if have a 32 or 64 bit system type.) Right click on the downloaded .zip file, choose Properties, and click the Unblock button if there is one. Then, open the .zip file, and drag the files into the right location in your OpenSolver Solvers folder (the win32, win64 or osx folder as appropriate), replacing the existing files. This may fix your problem.

**Report a CBC bug**

If after installing the latest version of CBC, CBC still crashes on you, then you may wish to report a bug. Please be sure to include the .lp file produced by OpenSolver; you can open this file using “View Last Model .lp File”. CBC bugs can be reported by either:

- The online CBC TRAC bug reporting system (which you will have to register for), or
- The CBC mail list

**Switch from CBC to Gurobi**

Since August 2014, OpenSolver has also supported solving models using the Gurobi solver. You can obtain a copy of this solver at no charge if you are at a university. Gurobi is faster and more stable than CBC, and comes highly recommended.

### 5. Repairing Excel

Sometimes it is useful (if all else fails) to repair your Office installation:

**Windows**

See these Microsoft Office 2010 and later instructions (or in Excel 2007, use Excel’s application menu, then Excel Options, then Resources, then “run Microsoft Office Diagnostics”). You might also want to look at http://support.microsoft.com/kb/166273, which talks about this.

**Mac**

Unfortunately there is no easy way to repair the Office 2011 installation. The best option is to follow these instructions to completely uninstall Office. You can then install Office again from scratch to get a clean version installed.

### 6. ‘Can’t find project or library’ : Missing Reference Errors

OpenSolver uses the “RefEdit” control, which we need but which can cause problems because of missing references caused by version changes. To check for missing references, using the VBA editor (which you access using Alt-F11), select OpenSolver (openSolver.xlam) in the Project window, choose Tools… References, and look for a “Missing:” line. If you see this, un-check that line, close the dialog, and choose File … Save OpenSolver.xlam to update the file. If this doesn’t help, try the above steps for repairing Excel.

**7. Error 70: Unable to delete the file: C:\Users\XXXXXX\AppData\Local\Temp\log1.tmp**

This errors happens if Excel crashes while OpenSolver is running, leaving log1.tmp open. Please restart your computer, which will close this file, and try again.

**8. OpenSolver was working on my Mac. Then I updated to Excel 16.16.7 (released late 2018) and OpenSolver stopped working. What do I do?**

We have had numerous users report this issue. We are looking for a Mac user with VBA experience to help us diagnose this problem. Please contact us at email hidden; JavaScript is required if you can help.

I cannot load the NOMAD Solver, though I have unzipped all of the files in the latest download. I’ve stored the unzipped files in my addins folder so that I don’t have to keep opening the xlsm file each time. I’d like to “Optimizing the output of VBA macros with NOMAD”. Thanks!

Hello everyone,

Can anyone advise the code to set the open solver sensitivity report to generate everyone you run the open solver model using vba? I have it capturing the constraints etc I just cannot get it to produce the final report on a new sheet?

Thanks in advance

Simon

Hello. Version 2.9.0 does not work in Windows XP. Tell me, please, the latest version number, which was tested in Windows XP. Thank you in advance.

I suggest you look at the release dates; I cannot recall when we last used Windows XP! Andrew

Hi my IT department says opensolver contains malware and sophos -our security system terminates excel upon running opensolver and blocks caller check.

Can we verify that this does not contain any malware as i cannot use opensolver if malware is present.

We get people reporting this every so often. I suggest you upload the file to http://VirusTotalcom. You will see that 57 of the 62 virus checkers (including the well known ones such as AVG, ESET-NOD32 — which we use at our University — and Microsoft’s BitDefender) say it is fine. Some of the lesser known packages get it wrong. We include code to launch .exe files (to run the solvers), and that perhaps triggers the false warning. Hope this helps convince your IT department. Andrew

so checking it at VirusTotal.com because the advanced opensolver win is from scourgeforge, there is a baidu trojan wisdom eyes and also a trend micro house call ad aware. not sure how i would get rid of it from the zip file?

I think you may be misunderstanding Virus Total. Baidu, TheHacker and TrendMicro-HouseCall are names of Virus CHECKERS, not viruses. These checkers are incorrectly identifying problems that none of the other 61 virus checkers believe exist. Hence, I suggest that the correct conclusion is that the file is clean (and 3 of the virus checkers are producing results you should ignore). Hope this helps, Andrew

Dears,

May I ask, what this error mean? and what I suppose to do?

Error -2147220501: Unable to find CBC (‘cbc.exe’). Folders searched:

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win64

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win32

Solver: CBC

Version 2.7.1 (2015.06.28) running on 64-bit Windows 10.0 with VBA7 in 32-bit Excel 15.0

Unable to find CBC (‘cbc.exe’). Folders searched:

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win64

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win32

Unable to find OpenSolver Gurobi script (‘gurobiOSRun.py’). Folders searched:

C:\Users\lawankok\Desktop\MTP2020-24\Solvers

Unable to find Bonmin (‘bonmin.exe’). Folders searched:

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win64

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win32

Unable to find Couenne (‘couenne.exe’). Folders searched:

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win64

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win32

Unable to find NOMAD (‘OpenSolverNomad.dll’). Folders searched:

C:\Users\lawankok\Desktop\MTP2020-24\Solvers\win32

You have moved items out of the OpenSolver folder, which breaks things. Andrew

Open Solver works for MacOS HighSierra with the latest Excel update 16.24 but if you upgrade your OS to Mojave it no longer works for some reason. Thought I’d give a heads up to the Mac peeps.

Thanks; I’ve added this as a note on the Download page. Any idea why Mojave breaks it? Andrew

I have a fully functioning model. Solving the model works.

There are some ‘input cells’ which I change in between different solves.

Changing the values in these cells and then hitting ‘Solve’ again, still works.

Constructing the model each time is quite slow however, so I would like to use Quick Solve

However, it seems that I don’t understand how to select the correct parameters for Quick Solve

The structure of my model is not as neat as the traditional example files (e.g. as shown in instructional videos). I have many different cells, each referring to other cells at different locations, and so forth.

My constraint cells have a formula in them which should simply always equal zero when the problem is solved, so all constraints are formulated as ‘these cells should equal zero’

I have tried out selecting many different combinations of ranges, each time setting them as the ‘Quick Solve Parameters’, but I can’t get Quick Solve to work. I guess this might have something to do with the fact that the cells with my input in them (which I change from solve to solve) also have an effect on other (intermediate) cells with formulas in them, which are not my final constraint cells. Simply selecting (as ‘Parameter cells’) all possible cells which have values in them that might change from solve to solve also does not work.

Are there any ‘rules of thumb’ to help me select the right cells as ‘Parameter cells’ for Quick Solve?

The only rule I can find so far is that the parameter cells should have something to do with the ‘right hand side of your constraints’, but this does not help me much because I don’t have a simple/clean model structure like the ones shown in the instructional videos. I also don’t have ‘right hand side’ values that change from solve to solve, because the ‘right hand side’ should simply always be equal to zero.

Considering the fact that my model does *work* if I change input values myself (manually) in between regular solves, I assume that it *should* in theory be possible to use the Quick Solve functionality, as long as I can select the correct parameter cells…

I can share my Excel file if this is helpful…

Any tips?

Cheers!

Quick Solver assumes the only change from new parameters is to the constraint right hand sides. Your model may not have this form and so quick solver may not work for you sorry. Andrew

Hello.

I just found out about OpenSolver and thought I’d give it a try.

My problem is that I cannot define the variables. My variables are cells belonging to several Gantt charts, so they are not continuous. I have tried manually writing down (see: https://pastebin.com/1TGXsBD6) all the variable cells and pasting them into the Variable Cells field of OpenSolver, and I get the following error:

Error: the cell range specified for the Variable Cells is invalid. This must be an Excel range that does not exceed Excel’s internal character count limits. Please correct this and try again.

I don’t think it exceeds the internal character count limits – it’s big but not that big! Also, I tried to put this argument into an Excel cell as a sum() function and I don’t get any errors.

Any ideas?

Thanks in advance.

Create a new block of decision cells, and put a formula in each old decision cell that gets a value from one cell in the new block of decision cells. Good luck. Andrew

Open solver cannot find a solution, while the standard Excel solver can.

For the standard solver embedded in Excel I select the ‘Simplex LP’ solver, and the solution is found almost instantly.

However, if I select any of the linear solvers embedded within Opensolver, it cannot find a solution.

Only if I select on non-linear solver in Opensolver, the same solution found by ‘Simplex LP’ can be found, albeit at a much slower speed.

Any idea what could be causing problems for Opensolver?

What ever it is, it is *not* a problem for the standerd Excel solver, using Simplex LP.

The problem being solved (target, constraints,…) is identical.

Cheers,

Sam

Sam,

Sorry it is not working. You can look at the .lp file to make sure we are correctly interpreting your model (which I am sure we are). You could then try Gurobi (or perhaps Cplex on NEOS); these are both commercial high quality solvers, and so I would trust their results. That said, it is likely to be a scaling issue. I assume CBC is saying the problem is infeasible? Does it have integer/binary requirements?

Andrew

Hi Andrew,

I seem to have fixed my problem by setting the goal to ‘Minimize’ instead of ‘Target Value’

While the standard embedded Excel solver could solve my problem when setting the goal for a specific cell to “Target Value = 0”, the problem was not solvable by any of the linear solver options when using OpenSolver

By setting the goal for the same cell to ‘Minimize’, the problem is now solvable with OpenSolver (using Gurobi), and the solution is identical. I.e. the value in the cell is ‘minimized to zero’

Hello!

I am using OpenSolver for my school project. I am running a linear programme.

My trouble is that OpenSolver takes around 1.5 hours to solve my programme, which has around 1200 variables. My friends who are also doing the project only take around half the time to solve the same problem. The difference is our Excel sheet models are probably different.

I do not understand why OpenSolver is taking such a long time to solve the programme. I tried to download SolverStudio to try to solve the problem faster but unfortunately, I do not know how to use Solver Studio as I do not know how to code.

I don’t mind sending over my Excel file if anyone needs it. I really hope to figure out why OpenSolver takes such a long time on my LP.

Thanks in advance for any help!

Perhaps you have plots or similar on the sheet? Or some integer or linear variables? Or just a big problem? Andrew

Question on multiple sheets: You say OpenSolver cannot cross multiple sheets. Does this mean within the model I can’t reference more than one sheet, yet a constraint cell can? For example, I have the constraint calculating on a seperate sheet, can I have a cell on the main sheet reference that? Or can the entire model only be contained on one sheet?

This comment is probably out of date. We are much better now at handling models that cross sheets, i.e. that have constraints or variables on multiple sheets. But we don’t recommend this as Excel is likely to be slower at recalculating across many sheets. Andrew

Could you explain what the cause of this error may be then?

Method ‘Range’ of object ‘_Worksheet’ failed

It normally indicates an error trying to parse a formula in a non-linear model. Sorry the error is not more helpful; this is an area on our ToDo list. Andrew

First of all, thanks a lot for the great tool!

I don’t quite understand the following restriction in the Quick Solve description:

‘OpenSolver assumes that this change [to the RHS] is a linear one’

The only linear change (I can think of) is a multiplication of the entire RHS with one constant, which would limit the use of this feature a lot.

Best regards,

Pete

The right hand side is a linear function of the parameters (which themselves are not part of the model). Andrew

I tried passing on a file I created with OpenSolver to a colleague (who doesn’t have OpenSolver), but even running a simple macro to change a table dimension generates the ‘Can’t find project or library’ error. Meanwhile, that exact same macro works fine in an earlier version without the OpenSolver tool.

Can someone explain why this is happening? Does OpenSolver impact other macros (that don’t use OpenSolver function)?

OpenSolver has no impact on other macros.