title: win32com Excel PasteSpecial
body: <p>I'm having some trouble with PasteSpecial in python.  Here's the sample code:</p>
  
  <pre><code>import win32com.client as win32com
  from win32com.client import constants
  
  xl = win32com.gencache.EnsureDispatch('Excel.Application')
  xl.Visible = True
  wb = xl.Workbooks.Add ()
  Sheet1 = wb.Sheets("Sheet1")
  
  # Fill in some summy formulas
  for i in range(10):
      Sheet1.Cells(i+1,1).Value = "=10*"+str(i+1)
  
  Sheet1.Range("A1:A16").Copy()
  Sheet1.Range("C1").Select()
  Sheet1.PasteSpecial(Paste=constants.xlPasteValues)
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>TypeError: Paste() got an unexpected keyword argument 'Paste'
  </code></pre>
  
  <p>I know that paste is a keyword argument because of the MSDN here:
  <a href="http://msdn.microsoft.com/en-us/library/office/ff839476(v=office.15).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/office/ff839476(v=office.15).aspx</a></p>
  
  <p>Any idea why it won't let me do this? Can't really find much on the web.  </p>
  
  <p>Edit for solution(s):</p>
  
  <pre><code>import win32com.client as win32com
  from win32com.client import constants
  
  xl = win32com.gencache.EnsureDispatch('Excel.Application')
  xl.Visible = True
  wb = xl.Workbooks.Add ()
  Sheet1 = wb.Sheets("Sheet1")
  
  # Fill in some summy formulas
  for i in range(10):
      Sheet1.Cells(i+1,1).Value = "=10*"+str(i+1)
  
  Sheet1.Range("A1:A16").Copy()
  Sheet1.Range("C1").PasteSpecial(Paste=constants.xlPasteValues)
  # OR this I just found right after I posted this works as well:
  xl.Selection.PasteSpecial(Paste=constants.xlPasteValues)
  </code></pre>