tags:

views:

20

answers:

1

I am exporting gridview to Excel in windows application successfully, but the problem is when I am going to Merge some range of cells in that excel sheet, it raises a windows dialogue box. So each and every time I am merging those cells it does not give any exception but it's showing a dialogue box.

I dont want that dialogue box, how do I hide it?

My Code for merging the cells is:

wksheet.get_Range(lstGetTotalTitleCells[0].ToString(), lstGetTotalTitleCells[lstGetTotalTitleCells.Count - 3].ToString()).MergeCells = true;

// wksheet.Range[GetRanges[0].ToString(), GetRanges[GetRanges.Count-2].ToString()].Merge();
+1  A: 

Did you try setting the DisplayAlerts property on the Application to false?

If you do try this, something to be aware of is that Excel will choose the default response on the dialog. You can read about the property here.

adrift