When I am trying to merge cells in a spreadsheet I get the error "The given key was not present in the dictionary.", I am able to merge cells accross columns on the same row using MergeAccross but I am unable to merge cells in the same column over multiple rows. I am not sure if this is a bug or if it just something I am doing. Any help would be appreciated.
For d As Integer = 0 To arrDate.GetUpperBound(0)
fromCellIndex = New CellIndex(5, d + 1)
toCellIndex = New CellIndex(10, d + 1)
xlWorkSheet.Cells(fromCellIndex, toCellIndex).Clear(ClearType.All)
nCellSelection = xlWorkSheet.Cells(fromCellIndex, toCellIndex)
nCellSelection.Merge() <-- Line the error gets thrown.
next d