title: pandas dataframe to excel with win32 : numpy datatype error
body: <p>I am trying to export a pandas dataframe to excel using win32. </p>
  
  <p>The export seems to work only when the dataframe does not include numpy datatypes. </p>
  
  <p><strong>How can I convert numpy datatypes to their COM variant ?</strong></p>
  
  <p>Here a reproducible example :</p>
  
  <pre><code> import pandas as pd
   from win32com.client import Dispatch
  
   # Prepare data
  
   # data without numpy data type
   xdata1 = {'state': ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada'],
       'year' : [2000, 2001, 2002, 2002, 2001],
       'pop'  : [1.5, 1.7, 3.6, 2.4, 2.9 ]}
  data1 = pd.DataFrame(xdata1, columns = ['year', 'state', 'pop'])
  xT1 = [tuple(x) for x in data1.values]# # data to tuples
  
  # data with numpy type
  data2 = pd.crosstab(data1.state, data1.year)
  xT2 = [tuple(x) for x in data2.values]  # data to tuples
  
  # export the data 
   from win32com.client import Dispatch
   xlApp = Dispatch("Excel.Application")
   xlApp.Visible = 1
   xlApp.Workbooks.Add()
   xlSheet = xlApp.ActiveWorkbook.ActiveSheet
  
   # write to excel
    xlSheet.Cells(1,1).Value = 'Python Rules!'   # THIS WORKS AS EXPECTED
  
   # Write to a range : data without numpy data type
    FirstRow = 2
    FirstCol = 3
    LastRow = FirstRow + len(xT1) - 1 # Number of records
    LastCol =  FirstCol + len(xT1[0]) - 1        # Number of columns
     xlSheet.Range(xlSheet.Cells(FirstRow, FirstCol), xlSheet.Cells(LastRow , LastCol)).Value = xT1  # THIS WORKS AS EXPECTED 
  
  
  
  # Write to a range : data WITH  numpy data type
  FirstRow = 2
  FirstCol = 5
  LastRow = FirstRow + len(xT2) - 1 # Number of records
  LastCol =  FirstCol + len(xT2[0]) - 1        # Number of columns
  xlSheet.Range(xlSheet.Cells(FirstRow, FirstCol), xlSheet.Cells(LastRow , LastCol)).Value = xT2  
  </code></pre>
  
  <p>THIS LINE PRODUCES AN ERROR </p>
  
  <p><strong>TypeError: Objects of type 'numpy.int64' can not be converted to a COM VARIANT (but obtaining the buffer() of this object could)</strong>   </p>
  
  <p>P.S: before someone asks (or suggest another way to export to export). I am using win32 on purpose because it is the only way I found to write to existing, pre-prepared excel file and keep the styles </p>
  
  <p>P.P.S : 
  Inspired by this <a href="https://stackoverflow.com/questions/9452775/">posting</a>, a solution I came up with is to change the type of each single element of the dataframe 
  I am sure there are better ways </p>
  
  <pre><code>def fnConvertdType (xListofList):
       newListofList = []
       for itemList in xListofList:
           xList = []
           for item in itemList:
               xList.append(np.asscalar(np.int16(item)))
           newListofList.append(xList)
       return newListofList
  </code></pre>