Guest User

Untitled

a guest
Apr 19th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Sub RunPython()
  2. shellScript = "python Daily.py"
  3. Dim wsh As Object
  4. Set wsh = VBA.CreateObject("WScript.Shell")
  5. wsh.CurrentDirectory = Application.ThisWorkbook.Path
  6. Set wshSystemEnv = wsh.Environment("Process")
  7. Set WshShellExec = wsh.exec(shellScript)
  8. Range("C7").Value = WshShellExec.StdErr.ReadAll ' Show error, if any
  9. End Sub
Add Comment
Please, Sign In to add comment