I'm having a problem calling python scripts from vba in Excel. I read other threads that addressed the same problem, but when I run the code, a Python screen flashes and then disappears. FYI, I downloaded python 3.6.5 for Windows 10 and added it to PATH. Can someone let me know why the screen flashes and what I can do to solve it? Thanks
Sub Run_python()
Dim Ret_Val
Dim args As String
args = "C:\Users\opera\AppData\Local\Programs\Python\Python36\Tools\scripts\db2pickle.py"
Ret_Val = Shell("C:\Users\opera\AppData\Local\Programs\Python\Python36\python.exe" & " " & args, vbNormalFocus)
If Ret_Val = 0 Then
MsgBox "Couldn't run python script!", vbOKOnly
End If
End Sub
input()statement at the end of your script? when the script finishes the window closes.