title: win32com in Python Spyder console results in an error
body: <p>I'm just running the following code, straight from <a href="http://pythonexcels.com/python-excel-mini-cookbook/" rel="nofollow">this documentation/tutorial</a>.</p>
  
  <pre><code>import win32com.client as win32
  excel = win32.gencache.EnsureDispatch('Excel.Application')
  wb = excel.Workbooks.Add()
  wb.SaveAs('add_a_workbook.xlsx')
  excel.Application.Quit()
  </code></pre>
  
  <p>And got this:</p>
  
  <pre><code>  execfile(filename, namespace)
    File "C:/Users/Username/Desktop/script.py", line 106, in &lt;module&gt;
      wb = excel.Workbooks.Add()
    File "C:\Users\Username\AppData\Local\Temp\gen_py\2.7\00020813-0000-0000-C000-000000000046x0x1x7\Workbooks.py", line 34, in Add
      ret = self._oleobj_.InvokeTypes(181, LCID, 1, (13, 0), ((12, 17),),Template
  TypeError: an integer is required
  </code></pre>
  
  <p>Does anyone have any idea why? I've tried using an xlsx vs. xls file, and changing the file address, and trying multiple examples from that tutorial, and they all give me similar errors, and I have no idea why. </p>
  
  <p>I can get as far as <code>wb = excel.Workbooks.Add()</code> before I get the <code>TypeError: an integer is required</code> warning, and if I try  <code>wb = excel.Workbooks.Add</code>, it will run and I won't get the error, but I can't do anything from there on.</p>
  
  <p>Does anyone know what this is? Thanks in advance.</p>
  
  <p>[Edit:]</p>
  
  <p>I tried a word file for comparison and I works fine.</p>
  
  <p>Does anyone know why one of these works and one doesn't?</p>
  
  <pre><code>word = win32.Dispatch('Word.Application')
  word.Documents.Open('C:\Users\username\Desktop\test.docx')
  
  excel = win32.Dispatch('Excel.Application')
  excel.Workbooks.Open('C:\Users\username\Desktop\output.xlsx')
  </code></pre>
  
  <p>[Edit 2:]</p>
  
  <p>Okay, I found the problem is with the Spyder IDE. If I write the same code in Anaconda, it'll work fine. Does anyone know why Anaconda works but Sypder doesn't? I checked the system paths and they're identical, and even trying to execute a .py program in Anaconda doesn't work.</p>