Hyperlink in merged cells results into two hyperlinks

Hello,

if you create merged cells and then enter a URL in them, for example http://www.aspose.com and click on Edit link in the context menu immediately afterwards and change the display name to Aspose.Cells, the hyperlink will appear twice!? As you can see in the example file once for cell A1 and once for A1:E3.

I am not sure which behavior is correct.

  1. An error in Excel
  2. A bug of Cells
  3. It’s so designed by Excel

Sample file
MergedCellsHyperlink.zip (6.2 KB)

Code

var workbook = new Workbook("MergedCellsHyperlink.xlsx");
var sheet = workbook.Worksheets[0];
// sheet.Hyperlinks has two items with same hyperlink but different area range

@mservdev

Thanks for using Aspose APIs.

We have tested this issue as per your description and found that it is Microsoft Excel behavior. Please see the following screenshot, it shows that there exists two hyperlinks instead of one.

Screenshot:

1 Like

Thanks a lot @shakeel.faiz for the explanation!

Looks like Excel “overwrites” the value of a single cell and places the merged cells above it.

@mservdev

Thanks for using Aspose APIs.

It is good to know that you were able to figure out this issue and Microsoft Excel behavior. Let us know if you encounter any other issue, we will be glad to look into it and help you further.