If you are trying to send a datagridview to an Excel spreadsheet, remember that Excel cells start in cell (1,1), but datagridview.rows and datagridview.columns are indexed to 0. So if you try to send the contents of datagridviewcell (0,0) to cell Excel (0,0), you will get an exception from HRESULT: 0x800A03EC
I desperately searched for a guru for 15 minutes before clapping my hand on the forehead for this.
Excel.Cells(0,0)=Datagridviewcellvalue
Excel.Cells(1,1) = Datagridviewcellvalue
source
share