Home > Back-end >  Running python script using Outlook VBA
Running python script using Outlook VBA

Time:10-20

Im trying to run a python script using Outlook Vba. When I run the below code. A python icon appears in the taskbar for a second and disappears. When in fact it should open a dialogue box and prompt me to enter folder name. After which it should run the rest of the script as usual.

Please help me run this script from outlook as I regularly do by double clicking the .py file.

Sub runpythonscript()

Dim Path As String

Path = "python C:\Doc Management\Exstream_Reconciliation.py"

Shell(Path)

End Sub

CodePudding user response:

VBA (nor Outlook) doesn't provide anything for debugging such cases. The best what you could do is to add log statements to the python script where you could output everything what happens in the code. Analyzing log files you will be able to figure the cause of the problem.

CodePudding user response:

You have a space in the file name. It must be quoted.

  • Related