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

Free Support Forum - aspose.com

Clearing TextBoxes not working

I am using version of Aspose.Cells. I am trying to convert a spreadsheet to PDF using Workbook.Save(). This spreadsheet contains a number of textboxes that I don’t want to be in the PDF file.

In an attempt to remove these textboxes, I tried clearing the TextBoxes collection property of the Worksheet class but after clearing the textboxes collection when I save the workbook as PDF, I can see all the textboxes there.

Why are the textboxes showing up in the PDF file?



I think you may try to use TextBoxCollection.RemoveAt(index) method to remove your unwanted text boxes in the worksheet, see the sample code snippet below:

Sample code:

Aspose.Cells.Drawing.TextBoxCollection textboxes = worksheet.TextBoxes;
textboxes.RemoveAt(0); //Remove the first text box.
//You may write your own code to loop through the text boxes in the worksheet to remove each text box.

Thank you.

Thanks Amjad. RemoveAt seems to be working. I thought Clear() removes all the textboxes. If this is not what Clear() does, then when will someone use Clear()?


I have logged a ticket with an id “CELLSNET-41849” for the issue regarding TextBoxCollection.Clear() method. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.


Thanks for your posting and using Aspose.Cells for .NET.

We have fixed the issue.

Please download and try this fix: Aspose.Cells for .NET (Latest Version) and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-41849) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.