title: Win32com Module Problems
body: <p>I want to convert .xls to .xlsx, so I use win32com module</p>
  <p>this is my code:</p>
  <pre class="lang-py prettyprint-override"><code>import os
  import win32com.client as win32
  address = address = os.getcwd()
  
  fname = address + &quot;\\Bundles.xls&quot;
  fname2 = address + &quot;\\searchresults.xls&quot;
  excel = win32.gencache.EnsureDispatch('Excel.Application')
  excel2 = win32.gencache.EnsureDispatch('Excel.Application')
  wb = excel.Workbooks.Open(fname)
  wb5 = excel.Workbooks.Open(fname2)
  
  wb.SaveAs(fname+&quot;x&quot;, FileFormat = 51)
  wb5.SaveAs(fname2+&quot;x&quot;, FileFormat = 51)    #FileFormat = 51 is for .xlsx extension
  wb.Close()
  wb5.Close()                               #FileFormat = 56 is for .xls extension
  excel.Application.Quit()
  excel2.Application.Quit()
  print('File .xls convert .xlsx successful!!')
  </code></pre>
  <p>then I got the error, here it is the traceback:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;c:/Users/shenshuaic/Desktop/SFP Program/win32test.py&quot;, line 7, in &lt;module&gt;
      excel = win32.gencache.EnsureDispatch('Excel.Application')
    File &quot;C:\Users\shenshuaic\AppData\Roaming\Python\Python37\site-packages\win32com\client\gencache.py&quot;, line 527, in EnsureDispatch
      disp = win32com.client.Dispatch(prog_id)
    File &quot;C:\Users\shenshuaic\AppData\Roaming\Python\Python37\site-packages\win32com\client\__init__.py&quot;, line 96, in Dispatch
      return __WrapDispatch(dispatch, userName, resultCLSID, typeinfo, clsctx=clsctx)
    File &quot;C:\Users\shenshuaic\AppData\Roaming\Python\Python37\site-packages\win32com\client\__init__.py&quot;, line 37, in __WrapDispatch
      klass = gencache.GetClassForCLSID(resultCLSID)
    File &quot;C:\Users\shenshuaic\AppData\Roaming\Python\Python37\site-packages\win32com\client\gencache.py&quot;, line 183, in GetClassForCLSID
      mod = GetModuleForCLSID(clsid)
    File &quot;C:\Users\shenshuaic\AppData\Roaming\Python\Python37\site-packages\win32com\client\gencache.py&quot;, line 226, in GetModuleForCLSID
      mod = GetModuleForTypelib(typelibCLSID, lcid, major, minor)
    File &quot;C:\Users\shenshuaic\AppData\Roaming\Python\Python37\site-packages\win32com\client\gencache.py&quot;, line 266, in GetModuleForTypelib
      AddModuleToCache(typelibCLSID, lcid, major, minor)
    File &quot;C:\Users\shenshuaic\AppData\Roaming\Python\Python37\site-packages\win32com\client\gencache.py&quot;, line 552, in AddModuleToCache
      dict = mod.CLSIDToClassMap
  AttributeError: module 'win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9' has no attribute 'CLSIDToClassMap'
  </code></pre>