title: AttributeError: 'module' object as no attribute '_Application'
body: <p>At end of my program, I am generating word file then converting this file to .pdf file format as the following:</p>
  
  <pre><code>wdFormatPDF = 17
  word = comtypes.client.CreateObject('Word.Application')
  doc = word.Documents.Open(resultfile)
  doc.SaveAs(resultfilepdf, FileFormat=wdFormatPDF)
  doc.Close()
  word.Quit()
  </code></pre>
  
  <p>The program run properly but when I converting the </p>
  
  <p>.py to .exe using pyinstaller –onefile option I get the following error when executing the .exe file.</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\python\tub\test\hc.py", line 344, in &lt;module&gt;
      word = comtypes.client.CreateObject('Word.Application')
    File "C:\Users\LT440\Anaconda2\lib\site-packages\comtypes\client\__init__.py", line 250, in CreateObject
  return _manage(obj, clsid, interface=interface)
    File "C:\Users\LT440\Anaconda2\lib\site-packages\comtypes\client\__init__.py", line 188, in _manage
  obj = GetBestInterface(obj)
    File "C:\Users\LT440\Anaconda2\lib\site-packages\comtypes\client\__init__.py", line 112, in GetBestInterface
  interface = getattr(mod, itf_name)
  AttributeError: 'module' object has no attribute '_Application'
  [4112] Failed to execute script hc
  </code></pre>
  
  <p>Please advice.</p>