|
Excel spreadsheet in charge |
Top Previous Next |
|
One way GAMS can be used is as a slave to Excel that solves a predefined problem and facilitates data transfers. A little history is in order before showing exactly how this works. A number of years ago GAMS Corporation had a section on their web site displaying linkages and an early version of the Excel/GAMS linkage program was there. However, I was unaware that it was a GAMS / Excel interface. Later Rob Davis with the Bureau of Reclamation came to one of my classes and told me he had been using an interface based on that GAMS program. I then looked into it and in the process reprogrammed the Excel macros slightly to improve the process and separate out the code functions to facilitate use by others. I also received assistance from Erwin Kalvelagen and Paul van der Eijk at GAMS Corporation in terms of finding the path for the GAMS system by reading the gamside.ini file. Finally, recent efforts led to me updating to use the Gdxxrw interface and Tanveer Butt assisted in that effort. So below I discuss an Excel / GAMS interface which is a product of many. The base application involves a spreadsheet (excelincharge.xls) built around a transportation model implemented in the GAMS program excelincharge.gms. The application is centered around a map. The first page of the spreadsheet (Mapsheet) appears as follows
In this worksheet pressing each of the colored state maps transfers focus to a worksheet associated with state. Also pressing the buttons on the right causes macros to run which place you in the Visual Basic Editor, transfer you to the transport rate page, run GAMS, or exit. |