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

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.