Free Support Forum - aspose.com

CreateRange Merge works incorrectly

In v3.0.4 CreateRange( … ).Merge() is not working at all

Could you please post your sample code here? I didn’t find the problem in my machine. Thank you very much.

Excel excel = new Excel();
Worksheet worksheet = excel.Worksheets[0];
Cells cells = worksheet.Cells;

for (int rowIndex = 0; rowIndex < 20; ++rowIndex)
{
cells[rowIndex, 0].PutValue("Help");
cells.CreateRange(rowIndex, 0, 1, 20).Merge();
}

Only first row columns are merged.
In some specific cases exception was thrown.

Please try this fix.

Thank you.
It works Smile