title: Shell call from Excel VBA freezes - involves MacScript and Python (Excel for Mac 2011)
body: <p>This macro runs fine on Excel 2011 for Mac:</p>
  
  <pre><code>Sub Works()
      scriptToRun = "do shell script ""/anaconda/bin/python -c "" &amp; quoted form of ""import test_file"" "
      res = MacScript(scriptToRun)
      Debug.Print res
  End Sub
  </code></pre>
  
  <p>The according <code>test_file.py</code> file (place it somewhere on the pythonpath) is:</p>
  
  <pre><code>import sys
  print(sys.version)
  </code></pre>
  
  <p>However, when I involve the <code>appscript</code> Python package, it freezes for a very long time and does nothing. Change the <code>test_file.py</code> file to this (<code>pip install appscript</code> first):</p>
  
  <pre><code>import appscript
  app = appscript.app('Microsoft Excel')
  app.cells['A1'].value.set(2)
  </code></pre>
  
  <p>But when I run the command directly from the AppleScript Editor, this works:</p>
  
  <pre><code>do shell script "/anaconda/bin/python -c " &amp; quoted form of "import test_file"
  </code></pre>
  
  <p>How can I call this from Excel VBA on Mac? (By the way on Windows, it works easily with <code>WScript.Shell</code> and <code>pywin32</code>)</p>