title: Is there a way to call python with xlwings without reopening the Excel file?
body: <p>I am calling python from Excel using xlwings. I find that when running my macro, Excel closes and reopens in order to run the code. It functions correctly but it slows things down. In addition, if the Excel file is unsaved a dialog will mention that the file is already open and that I will lose unsaved changes.</p>
  
  <p>Is there a way to call python without reopening the Excel file?</p>
  
  <p>This is my python code (in loaddf.py):</p>
  
  <pre><code>from xlwings import Workbook, Range, Sheet
  
  def my_macro():
      wb = Workbook.caller()
      Range('A1').value = Range('A1').value + 1
  </code></pre>
  
  <p>And the VBA code in my Excel file:</p>
  
  <pre><code>Sub loaddfsub()
      RunPython ("import loaddf; loaddf.my_macro()")
  End Sub
  </code></pre>
  
  <p>Thanks for the help.</p>