Hi,
We also seem the have the same issue here.
We want to accomplish the following; we want to have a textbox shape on our first cell which has a fixed width and a variable height. The rows under this cell have some data in it. The input text should be completely displayed, make the textbox longer and should not overflow to the right. The cell should also grow vertically so the data is not overlapped with the shape.
In our input (attached) file already has the data and the textboxshape.
The I run this code*;
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”)
objShape.Text = String.Format(“very long text the first line is the longest, longer, longer, very very long {0} not as long {0} even shorter {0} or was it”, vbCrLf)
objShape.TextFrame.AutoSize = True
objWorksheet.Cells.Rows(0).Height = objShape.CalculateTextSize()(1)
objWorkbook.Save(“C:\output.xls”, SaveFormat.Excel97To2003)
I observed the following;
- objShape.Height property is still the original height
- the objShape.CalculateTextSize function** returns an array of two variables of which (I assume) the first one is the new height. But this value was to large.
Please see the attached “output” file
Could you please provide a workaround or link us to the existing issue so we will also be up to date?
Also I would like the know why I do not get any data when I call the “LinkedCell” property of the objShape? I would have expected “A1”…
With warm regards,
Sjoerd van Loon
Senior Software Engineer
Infoland BV
* tested against aspose.cells 8.0.0
** I could not find any documentation about this function using google or the internal search of your website.