[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] [Fwd: C# API Exception]
From: |
Heinrich Schuchardt |
Subject: |
Re: [Help-glpk] [Fwd: C# API Exception] |
Date: |
Wed, 14 Jun 2017 23:21:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
>> I would like to know if I could get your advice on how to use the API in VBA.
Dear Curtis,
GLPK for Windows 4.61 comes with VBA examples in directory
glpk-4.61\examples\vba
Please, find the README.txt I have prepared for the next release below.
Best regards
Heinrich Schuchardt
Visual Basic for Applications examples for GLPK
===============================================
This directory contains multiple examples demonstrating calling the GLPK
library from VBA.
- glpk.bas contains the definitions of the library functions.
- errdemo.bas demonstrates error handling.
- gmpl.bas loads a GMPL model and solves the problem.
- lp.bas solves a linear problem.
- mip.bas solves a mixed integer problem.
To run the examples follow the steps below:
- Open Excel
- Either press ALT+F11 or select menu entry Developer -> View code.
- With menu entry File -> Import File import the modules.
- In glpk.bas replace "glpk.dll" with the full path to the relevant dll:
w32/glpk_4_62_stdcall.dll for 32bit Windows,
w64/glpk_4_62.dll for 64bit Windows.
- Press CTRL+G or select menu entry View -> Immediate Window.
- Press F5 to run an example. The output is shown in the immediate
window.
- To run gmpl.bas call function gmpl_main passing the name of a GMPL
model file as parameter.