[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Help-glpk] about Vba/glpk dll
From: |
Meketon, Marc |
Subject: |
RE: [Help-glpk] about Vba/glpk dll |
Date: |
Thu, 2 Apr 2009 11:01:57 -0400 |
The "Run_Optimizer" subroutine is where you pass in the names of the GMPL model
and data files, as well as a number of integer-programming. You would need to
write a small subroutine that reads the values of various cells (code like:
GMPLModelFileName = range("GMPLModelFileName").value if you used named ranges
to identify your paramters). Then call the Run_Optimizer routine.
You also have to change places where you output your solution in a database
table to output into a spreadsheet.
I realize this is sketchy but I really need to encourage you to figure this out
by yourself. Please note that if you search the GLPK help newsgroup, you will
find some reference to someone that used GLPK via Excel. This was a couple of
years ago, and it had links to a German website. It helped me a lot, but the
code was for an earlier version of GLPK.
BTW, I've benchmarked Xpress versus GLPK on several optimization programs and
Xpress in general is much faster in both model compilation, linear programming
and integer programming performance.
-----Original Message-----
From: Chang, Shih-yuan [mailto:address@hidden
Sent: Thursday, April 02, 2009 9:53 AM
To: Meketon, Marc
Subject: Re: [Help-glpk] about Vba/glpk dll
Dear Dr.Marc,
thank you for your reply, and i really appreicate it.
on the other hand, could you give me some instructions about how
to use these macro vba code to connect excel and glpk?
i'm working on an project which enable users to input the data
in the excel, which values as the parameters are passed into
optimization software,and then finally the result is return
and output displayed in excel.
The project was implemented by Xpress,
and now we are really eager to transform it to glpk.
thank you very much again!!
cheers
Rick
----- Original Message -----
From: "Marc Meketon" <address@hidden>
To: "Shih-yuan Chang" <address@hidden>, address@hidden
Sent: 2009年4月1日 星期三 下午09时12分17秒 GMT +08:00 Beijing / Chongqing / Hong Kong /
Urumqi
Subject: RE: [Help-glpk] about Vba/glpk dll
I sent to you separately the DLL that I recently compiled (version 4-36)
and a MS Access database that has VBA code that calls GLPK, allows a
variety of parameters to be changed, and (for integer programs) stores
all the integer solutions that GLPK finds.
I thought that it would be useful to other readers of this newsgroup to
mention this in case they need it as well.
It also shows how to use call-back functions and implements a VBA
version of the Driebeck-Tomlin heuristic.
This is experimental code, and probably has bunch of hardwire things and
debugging code and so on. But at least you could get a sense of how to
use GLPK in a VBA world, especially with MS Access. It also uses MS
Access to store the model output (the various simplex iterations) as
well as the solution.
I would like to acknowledge that Xypron gave me the code for the message
handler and few other things, and helped with the changes needed to tell
the compiler not to use __stdcall for the compare functions needed for
the qsort.
-Marc Meketon
-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of Chang, Shih-yuan
Sent: Wednesday, April 01, 2009 5:54 AM
To: address@hidden
Subject: [Help-glpk] about Vba/glpk dll
Dear Mr.Marc or Whom it may concern,
i have been looking for the interface between VBA and glpk for a long
time.
(and i learned that there is no direct interface)
i read your article in the forum and found the two links you posted-
http://www.informatikfuchs.de/Software/GLPK/glpkVB_Eng.htm
http://www.informatikfuchs.de/Software/GLPK/glpkVB_Eng.htm
however, those page just show some sponsor lists which doesn't solve my
problem.
so could you help me? (could you provide me the dll file i need to
connect vba and glpk?)
best regards
Rick
_______________________________________________
Help-glpk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-glpk
----------------------------------------------------------------------------
This e-mail and any attachments may be confidential or legally privileged. If
you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return e-mail.
Thank you for your cooperation.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
This e-mail and any attachments may be confidential or legally privileged. If
you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return e-mail.
Thank you for your cooperation.
----------------------------------------------------------------------------