### 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.

**9. OpenSolver does not work in Excel installed from the ****Windows Store**

Windows Store versions of Office applications do not support Add-ins such as OpenSolver; see this link, or this support page for another add-in, or this technical article from Add-in Express. This Dell article explains a little more. If you have a Windows Store version, it will display this in the Excel Version information, such as in the following example:

Version 1807 (Build 10325.20082 Microsoft Store)

The solution is to un-install Excel, and install the click-to-run versions, in which case the Excel version will change from ‘Microsoft Store’ to ‘Click-to-Run’. Standard installs (meaning not Office 365) don’t have this issue.

I am experiencing an issue once the app is installed in google sheets; the add-on is greyed out and won’t open. Please advise.

I am using OpenSolver with google sheets.

I works very well. However, if the cell name contains spaces, the solver tab doesn’t update cell references correctly.

example: my first sheet was called ‘ex1 – p1’, second ‘ex1 – p2’ and so on. When trying to update variables, objetive etc for the second sheet, nothing happened. I went back to the first and ran its solver again. It worked OK, because references weren’t lost.

Tried updating values from the first sheet (now renamed with the spaces) and it didn’t work.

I did, however, manage to use it by renaming sheets from ‘ex1 – p1’ to ‘e1p1’.

Thanks; that is very useful feedback. I hope that one of our summer students (NZ summer time) has Javascript skills to look at this. Andrew

Hello.

I am using OpenSolver 2.9.3 to analyze forest management problems.

I wonder how much data the OpenSolver can handle.

Thanks

It is only limited by time and memory, and the very-problem-specific complexity required to create integer (not fractional) solutions. That said, SolverStudio (http://solverstudio.org) is much more powerful, but has more of a learning curve. Andrew

Hi Team,

Firstly just wanted to thank you for the amazing package. Looks visually so much better than the default solver as well as improved functionality. Bravo!

However, I wanted to ask for help regarding using OpenSolver on an optimization problem that I am trying to solve.

It is a facility-location planning problem, where I want to plant K (where K is arbitrary and user defined) distribution centers such that I am able to maximise the distance between the closest facilities to prevent cannibalization.

This is an interesting problem because the objective function is also a decision variable.

A smaller scale version of the problem (with about 7 locations) is solvable using Excel’s default solver using SimplexLP. But, this smaller scaled version does not work with OpenSolver, as “the objective cell does not appear to contain a numeric value”.

I was wondering if there was any work around for this in OpenSolver? Hoping to use OpenSolver to tackle larger problems.

Please tell us more about your model…. is it linear?

Opensolver not working on Google Sheets (Google account): everything is grey on the dedicated window..

Sorry it is not working for you. Perhaps someone who is using OpenSolver for Google Sheets and has encountered this issue can give some advice? Andrew

Opensolver not working in Google Sheets (September 26, 2022). I used it a few days ago, good extension.

So are you saying it was working, and then stopped working a few days later? We have not changed anything in that time. Andrew

Hi, I have the same issue.

I was using the solver in one Google Sheet doc one week ago. Then I copied that book and tried to work on that copy today, but the solver appears disabled. Now I am moving to the original documents and neither there is functioning.

We have not made any changes, so I don’t understand why the software is changing for you, sorry. Perhaps someone with more Google Sheets experience can comment? Andrew

I use OpenSolver in an intro to OR class. I often find that when I build and solve even small textbook problems (4 variable, 4 contraints) it takes an inexplicably long time to solve. E.g. 45 seconds with no visible progress, then it says “optimizing” at the bottom of the sheet, then another 5 seconds to solve. Then if I change the coefficients, it solves it instantly. I’m using the CBC solver in Office 2016 and Office 365. What’s happening? Is there something I can change to speed things up? Students are noticing that the Excel Solver is faster and want to use that, but I want them to use OpenSolver for it’s greater capabilities later.

Thanks for the help–

Sorry to hear of the slow run times. I have just checked, and it runs fine for me in my (somewhat old) Excel. I suspect this is something that Microsoft have done with their execution of VBA code, but cannot be sure. Have you got other workbooks open? That can often slow things down. It could be VBA checking the code signature; that requires talking to outside machines, and would only happen the first time the code executed I think. Also, VBA does some strange things with memory garbage collection that can give long delays. Sorry I cannot be more specific. To give me a clue, can you please give me your version string from the About OpenSolver dialog? Mine says (as an example): Version 2.9.3 (2020.03.01) running on 64-bit Windows 10.0 with VBA7 in 32-bit Excel 16.0. Thanks, Andrew. (PS: I am assuming you are running on Windows…)

Having difficulty with an issue on my sheet.

17 Sep 22 14:33:44 [OpenSolver.xlam] OperatorArgCountStack.PopCount: Line 3

17 Sep 22 14:33:44 [OpenSolver.xlam] SolverFileNL.ConvertFormulaToExpressionTree: Line 65

17 Sep 22 14:33:44 [OpenSolver.xlam] SolverFileNL.ProcessSingleFormula: Line 3

17 Sep 22 14:33:44 [OpenSolver.xlam] SolverFileNL.ProcessFormulae: Line 22: Non-linear parser failed while processing cell RealData_J206.

17 Sep 22 14:33:44 [OpenSolver.xlam] SolverFileNL.SolveModelParsed_NL: Line 15

17 Sep 22 14:33:44 [OpenSolver.xlam] SolverCommon.WriteModelFile: Line 16

17 Sep 22 14:33:44 [OpenSolver.xlam] SolverCommon.SolveModel: Line 42

17 Sep 22 14:33:44 [OpenSolver.xlam] OpenSolverAPI.RunOpenSolver: Line 15

Error 5: Invalid procedure call or argument

Non-linear parser failed while processing cell RealData_J206.

Solver: Couenne

Formula in the cell is a =SUMPRODUCT(($A$4:$A$198=C206)*$B$4:$B$198)+$B$199

I am not surprised. You have an IF embedded in a SUM(). I use these style formulae all the time, but not in optimisation models. You need to switch to the NOMAD solver (which only looks at the results of equations, never their formulae) or build this as a mathematical model (without doing IF’s and then multiplying the result). Hope this helps, Andrew

Opensolver ignores my constraints… I clearly say this and that cell needs to be >0, only to find it <0 after solving. This is absurd. I'm forcing it with using ABS formulas but it's preposterous

The Simplex Algorithm is a numerical procedure with tolerances, so small negative values are to be expected. Is that what you are seeing? What is the negative value that’s the problem?

Hi! I am using the solver Bonmin on a non-linear model with 24,699 decision variables. I keep getting the error: “Open solver 2.9.0 encountered an error: Type Mismatch” – can someone please help me understand what the issue may be?

Hi,

My model has become quite big and I would like to organize the constraints I created. Through the interface, there is no option to filter constraints nor to order them by alphabetical order. So I am looking for the location where my model is kept so that I can edit it with a text editor.

TL;DR: Where can I acces my model to modify it through a text editor ?

We don’t have a text editor for OpenSolver models (but have thought about doing this). You can use a Name Editor add-in to edit the named ranges where the model is stored, but it won’t be trivial. Or, for large models, we recommend http://solverstudio.org Cheers, Andrew

Hello, I am getting this message: ‘The model contains an Excel constraint which does not depend on the decision variables and is not specified.’ (then it specifies where the problem is). I don’t understand, because with the exact same parameters the built-in Excel solver does the job fine. Can anyone help? Thank you.

Maybe Solver ignores these constraints? But they generally make no sense to have in a model, and normally indicate a mistake. Andrew

I´m getting this error message when i add several variable cells:

“Error: the cell range specified for the variable cells is invalid. This must be a valid Excel range that does not exceed Excel’s internal character count limits. Please correct this and try again.”

Supposedly, Excel internal character count limit is above 30.000. The range i´m trying to use is below 1.000, so i don´t know what my mistake is.

We simply report the Excel error, but don’t impose any further limits. Excel doesn’t like your formulae, so you will have to shorten it (by, for example, putting all the variable cells in one range, and perhaps using formula in your current variable cells to get their values from your new range). Hope this helps, Andrew

I cannot get OpenSolver to work in Excel 2019. After I delete a constraint, I cannot enter another constraint by selecting the appropriate cell ranges. The worksheet name repeats multiple times with the cell ranges. Do I have something setup incorrectly? Thank you.

I wish if Opensolver could use Scip solver which seems to be powerful free solver and it can solve both .lp and .nl problems.

Opensolver can already produce .lp and .nl so it seems it could be easily (?) added.

-M

Adding SCIP would be a great addition. We would welcome volunteers to do this; the code base is well structured to allow extra solvers to be added. Andrew

PS: SCIP is not free, but we can interface to non-free solvers that users install themselves.