Shell will return to VBA before the command is actually completed. I think some use apiShellExecute in shell32.dll to avoid this issue.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of JoaoFlavio Sent: Thursday, September 09, 2010 1:50 PM To: [email protected] Subject: [Help-glpk] Problem on running a glpsol .bat file from VBA I'm trying to run a .bat file from VBA. It runs with any application, but not with glpsol. The code is below: Sub Run_Glpk() Dim Address As String Dim Comando As Variant Dim Result As Variant Address = "C:\Solver\SNP_48\" Comand = Address & "roda.bat" Result = Shell(Comand, vbMinimizedFocus) End Sub I attach a file ( http://old.nabble.com/file/p29671298/run_glpk.xlsm run_glpk.xlsm ) with another module (modShellAndWaitSimple) with almost the same objective. (One line added) Can anybody help me? Thanks, João Flávio ----- João Flávio de Freitas Almeida -- View this message in context: http://old.nabble.com/Problem-on-running-a-glpsol-.bat-file-from-VBA-tp29671298p29671298.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. _______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
_______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
