I would like to minimize the execution of the shell window and the execution of the python script with the code below:
Sub RunPython()
Dim oShell, oExec as Object
Dim sriptPath, scriptName, datas, oCmd as String
Dim weekNumber as Integer
Set oShell = CreateObject("WScript.Shell")
oCmd = "python.exe " & scriptPath & scriptName & " " & datas & " " & Str(weekNumber)
Set oExec = oShell.Exec(oCmd)
'We are waiting for the Shell script to be executed'
While oExec.Status = 0
Wend
MsgBox "Hagrid notebook update completed"
End Sub
It is imperative to keep the status information of the oExec
object. I tried to insert the notion vbMinimizedFocus
, but it doesn't work. Do you have an idea to solve this difficulty?