Free Support Forum - aspose.com

Hyperlink and InsertRow() bug

worksheet.Cells[1, 0].PutValue(“Hello”);
worksheet.Cells[2, 0].PutValue(“Hello”);
worksheet.Cells[3, 0].PutValue(“Hello”);
worksheet.Hyperlinks.Add(2, 0, 1, 1, “http://www.aspose.com”);
worksheet.Cells.InsertRow(1);

This correctly moves all the rows down one and their values, but fails to move the hyperlinks down, thus ending up with hyperlinks in the wrong rows!

Haydn

Hi Haydn,

Yes. InsertRow doesn’t move down hyperlinks now. But you can have a workaround:

worksheet.Cells[1, 0].PutValue(“Hello”);
worksheet.Cells[2, 0].PutValue(“Hello”);
worksheet.Cells[3, 0].PutValue(“Hello”);
worksheet.Cells.InsertRow(1);
worksheet.Hyperlinks.Add(3, 0, 1, 1, “http://www.aspose.com”);

Thanks for the tip, but it really doesn’t help. Basically, we need to insert a row late on, just before we save out the Excel spreadsheet, so we can’t use this workaround!

Cheers,

Haydn

I will fix it in the next hotfix. It will be released before the start of next week.

Thanks for your patience.

Hi,

I’ve just upgraded from 1.8.2 to 1.8.8.1 and my hyperlinks no longer work properly and I’ve changed no code. To insert a hyperlink, I do:

worksheet.Hyperlinks.Add(“A500”, 1, 1, “http://www.aspose.com”);

This worked fine before inserting in column A, row 500. The new version, 1.8.8.1 inserts this hyperlink (not even as a hyperlink) at “IJ1”.

What is going on?

Haydn

Hi Haydn,

I have fixed it. A new hotfix will be release at the end of this week.

Thanks for your patience.