We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

LinkedCell of Shape is not set

Hi,


A small issue occured while I was trying to replicate a bug.

When I have placed a shape in a cell in an template, and I open the template with Aspose.Cells 8.0.0.0, find the shape by name and check the LinkedCell property it is nothing.

While I would have expected "A1"

Dim objLicense As New Aspose.Cells.License()
objLicense.SetLicense(“Aspose.Cells.lic”)

Dim objWorkbook As New Workbook(“C:\input.xls”)

Dim objWorksheet As Worksheet = objWorkbook.Worksheets(0)

Dim objShape As Aspose.Cells.Drawing.Shape = objWorksheet.Shapes(“tb”)
Debug.Assert(Not String.IsNullOrWhitespace(objShape.LinkedCell), “LinkedCell property was nothing”)

Attached is the template.

Did I put the shape incorrectly in/on the cell? Or did I actually find a bug?

With kind regards,

Sjoerd van Loon
Senior Software Engineer
Infoland BV

Hi Sjoerd,

Thanks for your posting and using Aspose.Cells.

I have checked your input.xls in MS-Excel and found that it is not linked to any cell. If it was linked to cell A1, then MS-Excel would show =A1 on the formula bar when this shape was selected.

So, I modified it and linked it with cell A1 using the formula bar and now you see, both cell A1 and shape has same text i.e."Some text"

Then I run the following code and checked the linked cell property and it displayed A1. Please see the screenshot for your reference. I have also attached the input-modified.xls for you to view.

VB.NET


Dim objWorkbook As New Workbook(“input-modified.xls”)


Dim objWorksheet As Worksheet = objWorkbook.Worksheets(0)


Dim objShape As Aspose.Cells.Drawing.Shape = objWorksheet.Shapes(“tb”)


Console.WriteLine(objShape.LinkedCell)


Screenshot:

H Shakeel,


Thank you very much for your explanation, it seems that I misunderstood the property.

With kind regards,

Sjoerd van Loon
Senior Software Engineer
Infoland BV

Hi Sjoerd,

Thanks for your feedback and using Aspose.Cells.

It is good to know that you now understand the purpose of this property. Let us know if you encounter any other issue, we will be glad to look into it and help you further.