06-26-2018 10:08 AM
I create a python script to analyze an excel file and export another excel file (X) as the result.
My vbscript needs to execute the python script and wait until it finished to read this X excel file to do further processing.
I have tried with:
Call ExtProgram()
and
Set oShell = CreateObject("Wscript.Shell") oShell.Run exe & " " & PySc where: exe is path of python engine and PySc is path of Python Script
With these, DIAdem could not wait until the python script finishes to continue its execution. As the result, DIAdem got an error because X excel file was not available for the next processing.
Is there anyway, excepting pausing the script with pause(), to make this happen?
Thank you
Hai
06-26-2018 10:57 AM
Have your VBS script polling every x seconds/minuets on the folder to look for the X file using a "Do While" loop or something similar. Exit that loop only if the file is available. Possibly implement a timeout option.
06-26-2018 12:00 PM
Just use the wait option of run?
dim wshshell : Set wshshell = WScript.CreateObject ("wscript.shell") wshshell.run "c:\Windows\system32\cmd.exe", 6, True set wshshell = nothing