[Python] Calling .exe from VBA to create and save a document

Discussão em 'Python' iniciado por Stack, Agosto 4, 2025.

  1. Stack

    Stack Membro Participativo

    I wrote a Python script to scrape a table of data from a website and output to a csv. I then used cx_freeze to convert the python script to a .exe.

    When I run the .exe manually, it saves in the current directory.

    When I run the code below from Outlook, the csv is never created. No errors pop up.

    Dim wsh As Object, x As Integer
    Set wsh = VBA.CreateObject("Wscript.Shell")
    x = wsh.Run("cmd /c C:\Users\username\Desktop\Lindner_Scrape\build\exe.win32-3.6\Scrape.exe", 1, True)

    Continue reading...

Compartilhe esta Página