title: VBA script to trigger Python and saving down xlsx file
body: <p>I am trying to save the .xlsx file and using VBA as a wrapper to execute the python file. However,  I can validate that python code runs, but somehow .xlsx file is not saved. When I run the same python file via IDE, it saves down the .xlsx file.</p>
  
  <p><strong>VBA code</strong></p>
  
  <pre><code>Sub RunPython()
  
  Dim shell As Object
  Dim exepath, scriptPath As String
  
  Set Shell = VBA.CreateObject("Wscript.Shell")
  exePath = """C:\Program Files\...\python.exe"""
  scriptPath = "C:\....\mymodule.py"
  </code></pre>
  
  <p><strong>Python Script</strong></p>
  
  <pre><code>import pandas as pd
  import xlsxwriter
  
  df = pd.DataFrame(np.random.randn(5,2),index=range(0,10,2),columns =list('AB'))
  excel_file ='sample.xlsx'
  writer = pd.ExcelWriter(excel_file,engine='xlsxwriter')
  df.to_excel(writer,sheet_name='Data')
  print ("file read")
  writer.save()
  writer.close()
  </code></pre>