title: How to call python script on excel vba?
body: <p>Trying to call a python script on Vba and I am a newb. I tried converting the main script to an exe using py2exe and then calling it from VBA (shell) but the main script calls other scripts therefore it becomes complicated and I messed it up (my exe is not functional). Besides, the the main script is a large file and I do not want to revise it a lot.</p>
  <p>Bottomline, is there a way to call the main script from excel vba, without converting the script to an exe file.</p>
  <p>So far, I tried:</p>
  <pre><code>RetVal = Shell(&quot;C:\python27\python.exe &quot; &amp; &quot;import &quot; &amp; &quot;C:\\&quot; &amp; &quot;MainScriptFile&quot;)
  </code></pre>
  <p>It starts python.exe but does nothing else. Then I tried:</p>
  <pre><code>RetVal = Shell(&quot;C:\Windows\System32\cmd.exe &quot; &amp; &quot;python &quot; &amp; &quot;C:\\Python27\\hello.py&quot;)
  </code></pre>
  <p>It starts command prompt but does not even start python.</p>
  <p>P.S. I checked all the related questions in the forum, they do not solve my prob.</p>