title: Pass Python Argument Through VBA
body: <p>I have written a python script that needs to be called using VBA. I have written a python script that can parse through a pdf, store the data I need in variables, and write to a pre-made excel sheet to fill in the cells with those values. I have successfully been able to call that script and run it using the following code:</p>
  <pre><code>Sub RunPythonScript()
  
  'Declare Variables
  Dim objShell As Object
  Dim PythonExe, PythonScript As String
  
  'Create a new Object shell.
  Set objShell = VBA.CreateObject(&quot;Wscript.Shell&quot;)
  
  'Provide file path to Python.exe
  'USE TRIPLE QUOTES WHEN FILE PATH CONTAINS SPACES.
  PythonExe = &quot;&quot;&quot;C:\Python38\python.exe&quot;&quot;&quot;
  PythonScript = &quot;C:\Users\matthew_vidovic\Documents\dwf-python\fedExPDF.py&quot;
  
  'Run the Python Script
  objShell.Run PythonExe &amp; PythonScript
  
  End Sub
  </code></pre>
  <p>The final step for me is to be able to pass in a pdf file from VBA rather than in the python script.
  Currently, inside my python script, I open a pdf and store it as text with the following code</p>
  <pre><code>raw = parser.from_file('nameofmyfile.pdf')
  pdfText = raw['content']
  </code></pre>
  <p>Rather than doing this, I want to be able to change the pdf file being analyzed from within vba, and not by changing the python script. Is there a way for me to pass an argument to the python script from vba, with the argument being the name of the pdf file. I need to be able to change the pdf file from vba and then the file be analyzed by the python script.
  Is something like this possible?
  Any help would be greatly appreciated.
  Cheers!</p>