This article guides the process to remove Excel table using C#. It has the details to set the IDE settings, a list of programming tasks, and a sample code to remove table format in Excel using C#. You will learn to remove the table based on different criteria.
Steps to Clear Table Format in Excel using C#
- Set the IDE to use Aspose.Cells for .NET to delete tables
- Load the source Excel file with a table using the Workbook object
- Select a sheet to remove the table formatting
- Access the collection of list objects containing the tables
- Set the show totals flag to false
- Call the RemoveAt() method by providing the index of the table to remove
- Save the resultant Excel file after deleting the table format
These steps describe how to remove table format in Excel using C#. During this simple process, load the workbook and access the ListObjects collection from the target sheet. Set the ShowTotals flag to false and call the RemoveAt() method by providing the table index in the collection to remove the table formatting and keep the data.
Code to Undo Table in Excel using C#
This code demonstrates how to remove table in Excel using C#. You can delete table formatting by using the table index ninth collection or finding various properties of the target table in the collection and deleting the resultant tables. If you do not set the ShowTotals to false, it will display an additional line at the end of the original data showing the title for the total.
This article has taught us how to clear table format in Excel using C#. To insert a slicer in the sheet, refer to the article on How to insert a slicer in Excel using C#.