1

I'm using VBA on Excel to run a Python script. Here's what my module looks like:

Sub PythonButton()

RetVal = Shell("C:\Python27\python.exe C:\Users\myName\Desktop\test.py", 1)

End Sub

My command window opens up and appears to give some feedback but the window only remains for a split second. How do I get this window to stay open until, say, the user presses a key?

secretagentmango
  • 619
  • 2
  • 10
  • 17

1 Answers1

1

I ended up using a batch file with a "pause" in it instead:

Sub PythonButton()

RetVal = Shell("C:\Users\myName\Desktop\start.bat", 1)

End Sub

I let my batch file run the python script instead.

secretagentmango
  • 619
  • 2
  • 10
  • 17