title: Why do I keep getting a type error: This COM object can not automate the makepy process - please run makepy manually for this object with excel?
body: <p>Before I ran the code and it worked, now when I changed nothing it throws me an error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "C:\Python36-32\lib\site-packages\win32com\client\gencache.py", line 530, in EnsureDispatch
        ti = disp.<em>oleobj</em>.GetTypeInfo()
    pywintypes.com_error: (-2147418111, 'Call was rejected by callee.', None, None)</p>
  </blockquote>
  
  <p>During handling of the above exception, another exception occurred:</p>
  
  <p>Traceback (most recent call last):
    File "C:/Users/matth/Desktop/dad_app/test.py", line 5, in 
      excel = win32.gencache.EnsureDispatch('Excel.Application')
    File "C:\Python36-32\lib\site-packages\win32com\client\gencache.py", line 541, in EnsureDispatch
      raise TypeError("This COM object can not automate the makepy process - please run makepy manually for this object")
  TypeError: This COM object can not automate the makepy process - please run makepy manually for this object</p>
  
  <pre><code>import win32com.client as win32
  import time
  import sys
  import pyautogui
  pyautogui.alert("sdf")
  stock = sys.argv[1]
  excel = win32.gencache.EnsureDispatch('Excel.Application')
  wb = excel.Workbooks.Open('C:\\xampp\\htdocs\\dad_app\\template\\template.xlsm')
  ws = wb.Worksheets('Overview')
  ws.Range("E8").Value = stock
  time.sleep(10)
  wb.SaveAs('C:\\xampp\\htdocs\\dad_app\\data\\' + stock + '.xlsm')
  excel.Application.Quit()
  pyautogui.alert(stock)
  </code></pre>