title: Python win32com insert word object into Excel file
body: <p>Excel error: "Document not saved" when trying to insert multiple objects into excel file.  Works for zip and .mpp file extensions, but not working with .doc and .docx file types. Once inserted, the object shows a white unknown file image and simply says EMBED("Document","").  However, when I insert manually these docs I have no problems and they display as Word doc icon.  Any Suggestions?</p>
  
  <pre><code>import win32com.client as win32
  xl = win32.gencache.EnsureDispatch('Excel.Application')
  xl.Visible = 1
  wb = xl.Workbooks.Open('BlankTemplate.xlsx')  #New Excel file that is blank
  xl.DisplayAlerts = False
  ws = wb.Worksheets('Sheet1')
  dest_cell = ws.Range('C5')
  obj = ws.OLEObjects()
  </code></pre>
  
  <p>obj.Add(ClassType=None,Filename='Approval.zip',Link=False,DisplayAsIcon=False,Left=dest_cell.Left, Top=dest_cell.Top,Width=50,Height=50)
  obj.Add(ClassType=None,Filename='Final.docx',Link=False,DisplayAsIcon=True,Left=dest_cell.Left, Top=dest_cell.Top,Width=50,Height=50)
  obj.Add(ClassType=None,Filename='Release.doc',Link=False,DisplayAsIcon=True,Left=dest_cell.Left, Top=dest_cell.Top,Width=50,Height=50)
  obj.Add(ClassType=None,Filename='Platform.mpp',Link=False,DisplayAsIcon=False,Left=dest_cell.Left, Top=dest_cell.Top,Width=50,Height=50)</p>
  
  <pre><code>wb.SaveAs('ProjectDetailsAttachments.xlsx')
  xl.DisplayAlerts = True
  xl.Application.Quit()
  xl.Visible = 0    
  </code></pre>