Hi all,
I have developed an LP with the user interface in MS Excel. I am using the 
printf command to print selected results to a text file as follows:printf{s in 
Sorts} %d\n", SortQc[s] >> "result.txt";
The result.txt file is located in the same directory as the model and data 
files. When I run the program using the Gusek GUI, all works fine and the 
result.txt file writes to the correct directory. 
The problem is, that when I run the program from Excel (using the command line 
executable cmd.exe), it saves the result.txt file to C:\Users\me\Documents 
rather than the same directory as the model and data files. I have used the 
same code many times previously in MS Access with no issue but this is the 
first time I've tried it in Excel. I've compared the code from Access and Excel 
and can't find any differences so I'm stumped as to what might be the problem. 
Has anyone else experienced issues like this before? Below is some of the VBA 
code that I am using to run the model from Excel:
strArgument = strPathName & "glpsol.exe --model " & strModelName & " --data " & 
strFileNameBatchName = strPathName & "tempfile.bat"    intEmpFileNbr = 
FreeFileOpen BatchName For Output As #intEmpFileNbr        Print 
#intEmpFileNbr, strArgumentClose #intEmpFileNbrCall ShellandWait("cmd.exe /c " 
& BatchName)
Thanks for any assistance that you might be able to provide.
Joel                                      
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to