.NET (1327)
Children categories
This article is going to demonstrate how to split a specific table cell in PowerPoint using Spire.Presentation.
The original table:

Detail steps:
Step 1: Instantiate a Presentation object and load the PowerPoint file.
Presentation ppt = new Presentation();
ppt.LoadFromFile("Input.pptx");
Step 2: Get the first slide.
ISlide slide = ppt.Slides[0];
Step 3: Get the table on the slide.
ITable table = slide.Shapes[0] as ITable;
Step 4: Split the cell [1, 2] into 3 rows and 2 columns.
table[1, 2].Split(3, 2);
Step 5: Save the file.
ppt.SaveToFile("Split.pptx", FileFormat.Pptx2013);
Screenshot after splitting:

Full code:
using Spire.Presentation;
namespace Split_Table_Cells_in_PPT
{
class Program
{
static void Main(string[] args)
{
//Instantiate a Presentation object
Presentation ppt = new Presentation();
//Load the PowerPoint file
ppt.LoadFromFile("Input.pptx");
//Get the first slide
ISlide slide = ppt.Slides[0];
//Get the table
ITable table = slide.Shapes[0] as ITable;
//Split cell [1, 2] into 3 rows and 2 columns
table[1, 2].Split(3, 2);
//Save the file
ppt.SaveToFile("Split.pptx", FileFormat.Pptx2013);
}
}
}
Charts are commonly used in Microsoft Excel files to visualize numeric data. In some cases, you may need to save the charts in an Excel file as images in order to use them in other programs or other files such as PDFs and PowerPoint presentations. In this article, we will demonstrate how to convert charts in Excel to images in C# and VB.NET using Spire.XLS for .NET.
- Convert a Specific Chart in an Excel Worksheet to Image
- Convert All Charts in an Excel Worksheet to Images
- Convert a Chart Sheet to Image in Excel
Install Spire.XLS for .NET
To begin with, you need to add the DLL files included in the Spire.XLS for .NET package as references in your .NET project. The DLLs files can be either downloaded from this link or installed via NuGet.
PM> Install-Package Spire.XLS
Convert a Specific Chart in an Excel Worksheet to Image in C# and VB.NET
Spire.XLS provides the Workbook.SaveChartAsImage(Worksheet worksheet, int chartIndex) method which enables you to convert a specific chart in a worksheet as image. The following are the detailed steps:
- Initialize an instance of the Workbook class.
- Load a sample Excel file using Workbook.LoadFromFile() method.
- Get a specific worksheet by its index through Workbook.Worksheets[int worksheetIndex] property.
- Save a specific chart in the worksheet as image using Workbook.SaveChartAsImage(Worksheet worksheet, int chartIndex) method.
- Save the image to a PNG file.
- C#
- VB.NET
using Spire.Xls;
using System.Drawing;
using System.Drawing.Imaging;
namespace ConvertAExcelChartToImage
{
internal class Program
{
static void Main(string[] args)
{
//Initialize an instance of the Workbook class
Workbook workbook = new Workbook();
//Load a sample Excel file
workbook.LoadFromFile("Charts.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
//Save the first chart in the first worksheet as image
Image image = workbook.SaveChartAsImage(sheet, 0);
//Save the image to .png file
image.Save(@"output\chart.png", ImageFormat.Png);
}
}
}

Convert All Charts in an Excel Worksheet to Images in C# and VB.NET
To convert all charts in an Excel worksheet to images, you can use the Workbook.SaveChartAsImage(Worksheet worksheet) method. The following are the detailed steps:
- Initialize an instance of the Workbook class.
- Load a sample Excel file using Workbook.LoadFromFile() method.
- Get a specific worksheet by its index through Workbook.Worksheets[int worksheetIndex] property.
- Save all charts in the worksheet as images using Workbook.SaveChartAsImage(Worksheet worksheet) method.
- Save the images to PNG files.
- C#
- VB.NET
using Spire.Xls;
using System.Drawing;
using System.Drawing.Imaging;
namespace ConvertAllExcelChartsToImages
{
internal class Program
{
static void Main(string[] args)
{
//Initialize an instance of the Workbook class
Workbook workbook = new Workbook();
//Load a sample Excel file
workbook.LoadFromFile("Charts.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
//Save charts in the first worksheet as images
Image[] imgs = workbook.SaveChartAsImage(sheet);
//Save the images to png files
for (int i = 0; i < imgs.Length; i++)
{
imgs[i].Save(string.Format(@"output\chart-{0}.png", i), ImageFormat.Png);
}
}
}
}

Convert a Chart Sheet to Image in Excel in C# and VB.NET
You can use the Workbook.SaveChartAsImage(ChartSheet chartSheet) method to convert a chart sheet in Excel to image. The following are the detailed steps:
- Initialize an instance of the Workbook class.
- Load a sample Excel file using Workbook.LoadFromFile() method.
- Get a specific chart sheet by its index through Workbook.Chartsheets[int chartSheetIndex] property.
- Save the chart sheet as image using Workbook.SaveChartAsImage(ChartSheet chartSheet) method.
- Save the image to .png file.
- C#
- VB.NET
using Spire.Xls;
using System.Drawing;
using System.Drawing.Imaging;
namespace ConvertExcelChartSheetToImage
{
internal class Program
{
static void Main(string[] args)
{
//Initialize an instance of the Workbook class
Workbook workbook = new Workbook();
//Load a sample Excel file
workbook.LoadFromFile("ChartSheet.xlsx");
//Get the first chart sheet
ChartSheet chartSheet = workbook.Chartsheets[0];
//Save the first chart sheet as image
Image image = workbook.SaveChartAsImage(chartSheet);
//Save the image to .png file
image.Save(@"output\chartSheet.png", ImageFormat.Png);
}
}
}

Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
This article demonstrates how to replace an existing image with a new image in a PowerPoint document using Spire.Presentation.
The original image:

Detail steps:
Step 1: Instantiate a Presentation object and load the PowerPoint file.
Presentation ppt = new Presentation();
ppt.LoadFromFile("Input.pptx");
Step 2: Get the first slide.
ISlide slide = ppt.Slides[0];
Step 3: Append a new image to replace an existing image.
IImageData image = ppt.Images.Append(Image.FromFile("timg.jpg"));
Step 4: Replace the image which title is "image1" with the new image.
foreach (IShape shape in slide.Shapes)
{
if (shape is SlidePicture)
{
if (shape.AlternativeTitle == "image1")
{
(shape as SlidePicture).PictureFill.Picture.EmbedImage = image;
}
}
}
Step 5: Save the file.
ppt.SaveToFile("Output.pptx", FileFormat.Pptx2013);
Screenshot after replacing image:

Full code:
using Spire.Presentation;
using Spire.Presentation.Drawing;
using System.Drawing;
namespace ReplaceImage
{
class Program
{
static void Main(string[] args)
{
{
Presentation ppt = new Presentation();
ppt.LoadFromFile("Input.pptx");
ISlide slide = ppt.Slides[0];
IImageData image = ppt.Images.Append(Image.FromFile("timg.jpg"));
foreach (IShape shape in slide.Shapes)
{
if (shape is SlidePicture)
{
if (shape.AlternativeTitle == "image1")
{
(shape as SlidePicture).PictureFill.Picture.EmbedImage = image;
}
}
}
ppt.SaveToFile("Output.pptx", FileFormat.Pptx2013);
}
}
}
}
This article demonstrates how to detect the used themes in a PowerPoint document using Spire.Presentation.
Detail steps:
Step 1: Instantiate a Presentation object and load the PowerPoint document.
Presentation ppt = new Presentation(); ppt.LoadFromFile(@"Sample.pptx");
Step 2: Get the theme name of each slide in the document.
StringBuilder sb = new StringBuilder();
string themeName = null;
foreach (ISlide slide in ppt.Slides)
{
themeName = slide.Theme.Name;
sb.AppendLine(themeName);
}
Step 3: Save to a .txt file.
File.WriteAllText("themeName.txt", sb.ToString());
Output:

Full code:
using Spire.Presentation;
using System.IO;
using System.Text;
namespace DetectThemes
{
class Program
{
static void Main(string[] args)
{
//Instantiate a Presentation object
Presentation ppt = new Presentation();
//Load the PowerPoint document
ppt.LoadFromFile(@"Sample.pptx");
StringBuilder sb = new StringBuilder();
string themeName = null;
//Get the theme name of each slide in the document
foreach (ISlide slide in ppt.Slides)
{
themeName = slide.Theme.Name;
sb.AppendLine(themeName);
}
//Save to a .txt file
File.WriteAllText("themeName.txt", sb.ToString());
}
}
}
In Excel, cells can be filtered based on the cell color. This article is going to show you how to filter rows by cell color using Spire.XLS.
The example Excel file:

Detail steps:
Step 1: Instantiate a Workbook object and load the Excel file.
Workbook workbook = new Workbook();
workbook.LoadFromFile("sample.xlsx");
Step 2: Get the first worksheet.
Worksheet sheet = workbook.Worksheets[0];
Step 3: Add a color filter to filter cells based on cell color.
//Create an auto filter in the sheet and specify the range to be filterd sheet.AutoFilters.Range = sheet.Range["A1:A9"]; //Get the coloumn to be filterd FilterColumn filtercolumn = (FilterColumn)sheet.AutoFilters[0]; //Add a color filter to filter the column based on cell color sheet.AutoFilters.AddFillColorFilter(filtercolumn, Color.Red);
Step 4: Filter the data.
sheet.AutoFilters.Filter();
Step 5: Save the file.
workbook.SaveToFile("ColorFilter.xlsx", ExcelVersion.Version2013);
Screenshot:

Full code:
using Spire.Xls;
using Spire.Xls.Core.Spreadsheet.AutoFilter;
namespace FilterCells
{
class Program
{
static void Main(string[] args)
{
//Instantiate a Workbook object
Workbook workbook = new Workbook();
//Load the Excel file
workbook.LoadFromFile("sample.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
//Create an auto filter in the sheet and specify the range to be filterd
sheet.AutoFilters.Range = sheet.Range["A1:A9"];
//Get the coloumn to be filterd
FilterColumn filtercolumn = (FilterColumn)sheet.AutoFilters[0];
//Add a color filter to filter the column based on cell color
sheet.AutoFilters.AddFillColorFilter(filtercolumn, Color.Red);
//Filter the data
sheet.AutoFilters.Filter();
//Save the file
workbook.SaveToFile("ColorFilter.xlsx", ExcelVersion.Version2013);
}
}
}

Want to make your Excel data easier to explore and analyze? Auto Filters are your go-to tool. With just a few clicks, you can sort, filter and focus on the rows that matter. In this guide, you’ll learn how to add filters in Excel with C# using Spire.XLS for .NET, making it easy to insert Auto Filters into your spreadsheets. As a bonus, we’ll also show you how to remove Auto Filters in Excel when you're done.
Let’s dive in and make your spreadsheets smarter!
- Add Auto Filters to a Cell Range in Excel
- Apply Built-in Auto Filters in Excel: Date
- Create Custom Auto Filters in Excel
- Bonus: How to Remove Auto Filters in Excel
- Wrapping Up
- FAQ: Excel AutoFilter Questions Answered
What is Spire.XLS and Why Use It
Spire.XLS for .NET is a powerful Excel library that enables you to create, edit, and convert Excel files programmatically — no need for Microsoft Excel to be installed on your machine. It’s ideal for automating Excel tasks in C# and other .NET applications.
To get started, you can install the library via NuGet with the following command:
PM> Install-Package Spire.XLS
For smaller or lightweight Excel projects, the free version is available:
PM> Install-Package FreeSpire.XLS
If you prefer manual setup or need more installation options, you can also download Spire.XLS for .NET or Free Spire.XLS for .NET directly from the official website.
How to Add Auto Filters to a Cell Range in Excel
If you want to quickly filter data in an Excel sheet without writing formulas, Auto Filters will help to instantly display only the needed rows. In this section, you'll learn how to add Auto Filters to a specific cell range in Excel using C#. Whether you're working with a small table or a large dataset, this method helps streamline data analysis with just a few lines of code.
The steps to apply Auto Filters to a cell range with C#:
- Create a Workbook instance and read an Excel file.
- Get a certain worksheet.
- Add an AutoFilter to a specified cell range using Worksheet.AutoFilters.Range property.
- Save the modified Excel file.
Here’s a code example showing how to add an Auto Filter in the cell range “A1:C1”:
- C#
using Spire.Xls;
namespace AddAutoFilter
{
class Program
{
static void Main(string[] args)
{
// Create a Workbook instance
Workbook workbook = new Workbook();
// Load an Excel file
workbook.LoadFromFile(@"C:\Users\Administrator\Desktop\Data.xlsx");
// Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
// Create an AutoFilter in the sheet and specify the range to be filtered
sheet.AutoFilters.Range = sheet.Range["A1:C1"];
// Save the result file
workbook.SaveToFile("ExcelAutoFilter.xlsx", ExcelVersion.Version2016);
}
}
}

How to Add Built-in Auto Filters in Excel - Date
Excel’s built-in Auto Filters make it easy to filter data by common criteria like dates, numbers, and text. In this part, we’ll show you how to add a date Auto Filter in Excel using C#. The example focuses on applying a filter to a date column so you can quickly display rows based on specific days, months, or years.
- Create a Workbook instance and load a sample Excel spreadsheet.
- Get a worksheet and apply filters to a cell range through Worksheet.AutoFilters.Range property.
- Add a date filter to the cell range with Workbook.AutoFilters.AddDateFilter() method.
- Apply the date filter using Workbook.AutoFilters.Filter() method.
- Save the updated Excel file.
- C#
using Spire.Xls;
using Spire.Xls.Core;
using Spire.Xls.Core.Spreadsheet.AutoFilter;
namespace AddAutoFilter
{
class Program
{
static void Main(string[] args)
{
// Create a Workbook instance
Workbook workbook = new Workbook();
// Load an Excel file
workbook.LoadFromFile(@"C:\Users\Administrator\Desktop\Data.xlsx");
// Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
// Create an auto filter in the sheet and specify the range to be filtered
sheet.AutoFilters.Range = sheet.Range["A1:A12"];
// Get the column to be filtered
IAutoFilter filtercolumn = sheet.AutoFilters[0];
// Add a date filter to filter data related to February 2022
sheet.AutoFilters.AddDateFilter(filtercolumn, DateTimeGroupingType.Month, 2022, 2, 0, 0, 0, 0);
// Apply the filter
sheet.AutoFilters.Filter();
// Save the result file
workbook.SaveToFile("DateAutoFilter.xlsx", ExcelVersion.Version2016);
}
}
}

Quickly Apply Custom AutoFilter in Excel in C#
While built-in filters like date filters offer quick presets, there are times when you need more control over what gets displayed. That’s where custom AutoFilters come in. In this section, we’ll show you how to add a custom AutoFilter in Excel using C#, allowing you to filter by specific values or conditions — such as greater than, contains, or equals — to fit more complex data scenarios.
Steps to apply custom Auto Filters in Excel:
- Create a Workbook object and load an Excel file.
- Retrieve a worksheet.
- Add an Auto Filter to a cell range.
- Add a custom filter to the cell range through Workbook.AutoFilters.CustomFilter() method.
- Apply the filter using Workbook.AutoFilters.Filter() method.
- Save the resulting file.
- C#
using Spire.Xls;
using Spire.Xls.Core.Spreadsheet.AutoFilter;
namespace AddAutoFilter
{
class Program
{
static void Main(string[] args)
{
// Create a Workbook instance
Workbook workbook = new Workbook();
// Load an Excel file
workbook.LoadFromFile(@"C:\Users\Administrator\Desktop\Data.xlsx");
// Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
// Create an auto filter in the sheet and specify the range to be filtered
sheet.AutoFilters.Range = sheet.Range["G1:G12"];
// Get the column to be filtered
FilterColumn filtercolumn = (FilterColumn)sheet.AutoFilters[0];
// Add a custom filter to filter data containing the string "Grocery"
string strCrt = "Grocery";
sheet.AutoFilters.CustomFilter(filtercolumn, FilterOperatorType.Equal, strCrt);
// Apply the filter
sheet.AutoFilters.Filter();
// Save the result file
workbook.SaveToFile("CustomAutoFilter.xlsx", ExcelVersion.Version2016);
}
}
}

Bonus Tip: How to Remove AutoFilters in Excel
Once you're done filtering, removing AutoFilters in Excel is just as easy. You can clear filters from a worksheet using a single line of C# code. This helps reset the view and ensures your data is fully visible again.
Want the exact steps? Check out our full guide on how to remove AutoFilters in Excel, including detailed instructions and code samples.
Wrapping Up
Adding AutoFilters in Excel using C# doesn’t have to be complicated — whether you’re working with a standard cell range, dates, or applying custom filter criteria. With just a few lines of code, you can make your Excel spreadsheets far more interactive and easier to analyze.
FAQ: Excel AutoFilter Questions Answered
Q1: How do I quickly add filters in Excel using C#?
You can quickly add filters to a cell range in Excel by using the Worksheet.AutoFilters.Range property in C#. Just define the target range and apply the filter with a single line of code.
Q2: How do I insert a drop-down filter in Excel?
Excel AutoFilters are essentially drop-down filters. Once you apply an AutoFilter to a column, Excel automatically creates a drop-down menu that lets you sort or filter the data based on values, conditions, or custom criteria.
Q3: How do I add a drop-down slicer in Excel?
Slicers are a visual filtering tool mainly used with PivotTables. While AutoFilters apply to standard worksheets, slicers offer a more user-friendly UI for filtering PivotTable data. If you're working with regular data (not PivotTables), AutoFilters are the better choice.
Q4: Can I remove filters once they’re applied in Excel with C#?
Yes, you can easily remove filters using C#. Just call the Worksheet.AutoFilters.Clear() method to remove all active filters from your worksheet.
Adjust the Height of Headers and Footers in a Word document in C#
2018-08-16 02:52:41 Written by KoohjiThe height of headers and footers can be adjusted by using the HeaderDistance and the FooterDistance properties. The detail steps of how to adjust the height of headers and footers in a word document using Spire.Doc are shown below.
Detail steps:
Step 1: Instantiate a Document object and load the word document.
Document doc = new Document();
doc.LoadFromFile("Headers and Footers.docx");
Step 2: Get the first section.
Section section = doc.Sections[0];
Step 3: Adjust the height of headers and footers in the section.
section.PageSetup.HeaderDistance = 100; section.PageSetup.FooterDistance = 100;
Step 4: Save the file.
doc.SaveToFile("Output.docx", FileFormat.Docx2013);
Screenshot:
Header:

Footer:

Full code:
//Instantiate a Document object
Document doc = new Document();
//Load the word document
doc.LoadFromFile("Headers and Footers.docx");
//Get the first section
Section section = doc.Sections[0];
//Adjust the height of headers in the section
section.PageSetup.HeaderDistance = 100;
//Adjust the height of footers in the section
section.PageSetup.FooterDistance = 100;
//Save the document
doc.SaveToFile("Output.docx", FileFormat.Docx2013);
A table in Excel is a structured range of data that includes headers for each column. When you convert a range of cells into a table, Excel automatically applies formatting, adds filter arrows to each header cell, and provides enhanced features for manipulating and analyzing the data. In this article, we will explain how to create, resize, and remove tables in Excel in C# using Spire.XLS for .NET.
- Create a Table in Excel in C#
- Add a Total Row to a Table in Excel in C#
- Resize a Table in Excel in C#
- Remove a Table from Excel in C#
Install Spire.XLS for .NET
To begin with, you need to add the DLL files included in the Spire.XLS for .NET package as references in your .NET project. The DLL files can be either downloaded from this link or installed via NuGet.
PM> Install-Package Spire.XLS
Create a Table in Excel in C#
Spire.XLS for .NET allows you to convert a specific range of data in an Excel worksheet to a table using the Worksheet.ListObjects.Create(tableName, cellRange) method. The detailed steps are as follows.
- Create an object of the Workbook class.
- Load an Excel file using Workbook.LoadFromFile() method.
- Get a specific worksheet using Workbook.Worksheets[index] property.
- Get the cell range you want to convert to a table using Worksheet.Range[] property.
- Convert the cell range to a table using Worksheet.ListObjects.Create(tableName, cellRange) method.
- Save the resulting workbook to a file using Workbook.SaveToFile() method.
- C#
using Spire.Xls;
using Spire.Xls.Core;
namespace CreateTable
{
internal class Program
{
static void Main(string[] args)
{
//Create an object of the Workbook class
Workbook workbook = new Workbook();
//Load an Excel file
workbook.LoadFromFile("Sample.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
//Get the cell range you want to convert to a table
CellRange range = sheet.Range[1, 1, sheet.LastRow, sheet.LastColumn];
//Convert the cell range to a table
IListObject table = sheet.ListObjects.Create("SalesTransactions", range);
//Format the table with a built-in table style
table.BuiltInTableStyle = TableBuiltInStyles.TableStyleLight2;
//Save the resulting workbook to a file
workbook.SaveToFile("CreateTable.xlsx", ExcelVersion.Version2016);
workbook.Dispose();
}
}
}

Add a Total Row to a Table in Excel in C#
You can add a total row after the end of a table to display summary calculations, such as sums, averages, or other aggregations of the data in the table. The detailed steps are as follows.
- Create an object of the Workbook class.
- Load an Excel file using Workbook.LoadFromFile() method.
- Get a specific worksheet using Workbook.Worksheets[index] property.
- Get a specific table in the worksheet using Worksheet.ListObjects[index] property.
- Display a total row at the end of the table by setting Table.DisplayTotalRow property to true.
- Set total row label in a specific table column using IListObject.Columns[index].TotalsRowLabel property.
- Set the calculation functions for specific table columns using IListObject.Columns[index].TotalsCalculation property.
- Save the resulting workbook to a file using Workbook.SaveToFile() method.
- C#
using Spire.Xls;
using Spire.Xls.Core;
namespace AddTotalRowToTable
{
internal class Program
{
static void Main(string[] args)
{
//Create an object of the Workbook class
Workbook workbook = new Workbook();
//Load an Excel file
workbook.LoadFromFile("CreateTable.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
//Get the first table in the worksheet
IListObject table = sheet.ListObjects[0];
//Show total row
table.DisplayTotalRow = true;
// Set total row label
table.Columns[0].TotalsRowLabel = "Total";
//Set the function used for the total calculation
table.Columns[3].TotalsCalculation = ExcelTotalsCalculation.Sum;
table.Columns[4].TotalsCalculation = ExcelTotalsCalculation.Sum;
//Save the resulting workbook to a file
workbook.SaveToFile("AddTotalRow.xlsx", ExcelVersion.Version2016);
workbook.Dispose();
}
}
}

Resize a Table in Excel in C#
You can resize a table by updating the data range of it using IListObject.Location property. The detailed steps are as follows.
- Create an object of the Workbook class.
- Load an Excel file using Workbook.LoadFromFile() method.
- Get a specific worksheet using Workbook.Worksheets[index] property.
- Get a specific table in the worksheet using Worksheet.ListObjects[index] property.
- Resize the table by updating the data range of it using IListObject.Location property.
- Save the resulting workbook to a file using Workbook.SaveToFile() method.
- C#
using Spire.Xls;
using Spire.Xls.Core;
namespace ResizeTable
{
internal class Program
{
static void Main(string[] args)
{
//Create an object of the Workbook class
Workbook workbook = new Workbook();
//Load an Excel file
workbook.LoadFromFile("CreateTable.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
//Get the first table in the worksheet
IListObject table = sheet.ListObjects[0];
table.Location = sheet.Range["C1:E8"];
//Save the resulting workbook to a file
workbook.SaveToFile("ResizeTable.xlsx", ExcelVersion.Version2016);
workbook.Dispose();
}
}
}

Remove a Table from Excel in C#
If you no longer need a table, you can convert it back to a normal range of cells by using the IListObjects.RemoveAt(tableIndex) method. The detailed steps are as follows.
- Create an object of the Workbook class.
- Load an Excel file using Workbook.LoadFromFile() method.
- Get a specific worksheet using Workbook.Worksheets[index] property.
- Get the table collection of the worksheet using Worksheet.ListObjects property.
- Remove a specific table from the table collection using IListObjects.RemoveAt(tableIndex) property.
- Save the resulting workbook to a file using Workbook.SaveToFile() method.
- C#
using Spire.Xls;
using Spire.Xls.Core;
namespace RemoveTable
{
internal class Program
{
static void Main(string[] args)
{
//Create an object of the Workbook class
Workbook workbook = new Workbook();
//Load an Excel file
workbook.LoadFromFile("CreateTable.xlsx");
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
//Get the table collection of the worksheet
IListObjects tables = sheet.ListObjects;
//Remove a specific table by its index
tables.RemoveAt(0);
////Or remove a specific table by its name
//for (int i = tables.Count - 1; i >= 0; i--)
//{
// // Check if the table name matches the specific value
// if (tables[i].Name == "SalesTransactions")
// {
// // Remove the table
// tables.RemoveAt(i);
// }
//}
//Save the resulting workbook to a file
workbook.SaveToFile("RemoveTable.xlsx", ExcelVersion.Version2016);
workbook.Dispose();
System.Diagnostics.Process.Start("RemoveTable.xlsx");
}
}
}

Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
In Spire.Presentation, when we add a common animation effect that belongs to both entrance and exit types, it’s applied as entrance effect by default. This article is going to show you how to add exit animation effect to a shape in PowerPoint using Spire.Presentation.
Detail steps:
Step 1: Create a Presentation instance and get the first slide.
Presentation ppt = new Presentation(); ISlide slide = ppt.Slides[0];
Step 2: Add a shape to the slide.
IShape starShape = slide.Shapes.AppendShape(ShapeType.FivePointedStar, new RectangleF(100, 100, 200, 200));
Step 3: Add random bars effect to the shape.
AnimationEffect effect = slide.Timeline.MainSequence.AddEffect(starShape, AnimationEffectType.RandomBars);
Step 4: Change the type of the effect from entrance to exit.
effect.PresetClassType = TimeNodePresetClassType.Exit;
Step 5: Save the file.
ppt.SaveToFile("ExitAnimationEffect.pptx", FileFormat.Pptx2013);
Screenshot:

Full code:
using Spire.Presentation;
using Spire.Presentation.Drawing.Animation;
using System.Drawing;
namespace AddExitAnimationEffect
{
class Program
{
static void Main(string[] args)
{
{
//Create a Presentation instance
Presentation ppt = new Presentation();
//Get the first slide
ISlide slide = ppt.Slides[0];
//Add a shape to the slide
IShape starShape = slide.Shapes.AppendShape(ShapeType.FivePointedStar, new RectangleF(100, 100, 200, 200));
//Add random bars effect to the shape
AnimationEffect effect = slide.Timeline.MainSequence.AddEffect(starShape, AnimationEffectType.RandomBars);
//Change effect type from entrance to exit
effect.PresetClassType = TimeNodePresetClassType.Exit;
//Save the file
ppt.SaveToFile("ExitAnimationEffect.pptx", FileFormat.Pptx2013);
}
}
}
}
This program guide focus on helping you how to make Spire.Doc workable on Windows and Linux.
Starts from V 6.7.4, Spire.Doc supports .NET Core 2.0. Spire.Doc uses System.Drawing.Common, which depends on Libgdiplus library. So when you use Spire.Doc on .NET core, you need to install Libgdiplus library.
On Windows, we recommend you to get Spire.Doc package via Nuget. The Libgdiplus library will be installed automatically.

On Linux, you need to install Libgdiplus library independently. Please follow the below three steps to install it successfully.
Step1: Open xxxx.csproj file and write the code snippet into it.
<ItemGroup> <PackageReference Include=”Spire.Doc” Version=”6.7.13”/> </ItemGroup>

Step 2. Execute "dotnet build" command on terminal window of Visual Studio Code. It will install Spire.Doc package.

Step 3. Open terminal window on Linux and execute Libgdiplus library installation command, for example, the command on Linux Ubuntu is "sudo apt-get install libgdiplus".

Then you can use Spire.Doc on .NET core.
If you have any question, please feel free to contact us.