Correct me if I am wrong, you want to copy data in your grid to a excel in column B, M and O from rows 27 onwards.
If you have a data source for the grid, you can loop through it and write to the excel. Here something that can help you to begin with assuming you have a data table as the data source of the datagridview.
for(int rowIndex = 0; rowIndex < rowCount; rowIndex++)
{
for(int colIndex = 0; colIndex < colCount; colCount++)
{
sheetObject.get_Range("cellPositionHere",Reflection.MissingValue).Value = dataSource[rowIndex][ColIndex].ToString();
}
}
Take a look at
this[
^] article for more help. Writing data through arrays is certainly much faster than writing cell by cell. But this depends on the data source you are using. If the converting data source to array takes more effort than writing data cell by cell, you can ignore that.