New to Telerik Document ProcessingStart a free 30-day trial

Using XlsxFormatProvider

Updated on Sep 8, 2026

XlsxFormatProvider imports and exports XLSX workbook files in RadSpreadProcessing. An XLSX file is a ZIP package that follows the Office Open XML specification. The provider preserves workbook data such as worksheets, formula values, formatting, and hyperlinks.

To use XlsxFormatProvider, reference one of the following packages:

  • Telerik.Documents.Spreadsheet.FormatProviders.OpenXml for cross-platform projects.
  • Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml for Windows-only projects.

Starting with Q2 2025 the Zip Library is no longer used as an internal dependency in the rest of the Document Processing Libraries - PdfProcessing, WordsProcessing, SpreadProcessing, SpreadStreamProcessing. It is replaced by the System.IO.Compression. The Telerik Zip Library continues to ship as a standalone library so clients can still use it separately.

After you reference the required package, create an instance of XlsxFormatProvider to import and export XLSX files. The provider is in the Telerik.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx namespace. XlsxFormatProvider implements the IWorkbookFormatProvider interface from the Telerik.Documents.Spreadsheet.FormatProviders namespace. The class also exposes ImportSettings and ExportSettings properties of type XlsxImportSettings and XlsxExportSettings.

For more examples and end-to-end scenarios, see how to import, export, save, and load RadSpreadProcessing workbooks.

Import

The following example shows how to import an XLSX file through a FileStream. The code verifies that a file with the specified name exists. The sample then creates an XlsxFormatProvider instance and passes the FileStream to its Import() method.

Example 1: Import an XLSX Workbook

C#
string fileName = "SampleFile.xlsx";
if (!File.Exists(fileName))
{
    throw new FileNotFoundException(String.Format("File {0} was not found!", fileName));
}

Telerik.Documents.Spreadsheet.Model.Workbook workbook;
XlsxFormatProvider formatProvider = new Telerik.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();

using (Stream input = new FileStream(fileName, FileMode.Open))
{
    workbook = formatProvider.Import(input, TimeSpan.FromSeconds(10));
}

Export

The following example shows how to export an existing Workbook to an XLSX file. The snippet creates a new workbook with a single worksheet. It then creates an XlsxFormatProvider instance and calls its Export() method. The Export() method accepts a Stream, so you can use any Stream implementation.

Example 2: Create a Workbook and Export It to an XLSX File Stream

C#
Telerik.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Documents.Spreadsheet.Model.Workbook();
workbook.Worksheets.Add();
string fileName = "SampleFile.xlsx";

Telerik.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider formatProvider = new Telerik.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();

using (Stream output = new FileStream(fileName, FileMode.Create))
{
    formatProvider.Export(workbook, output, TimeSpan.FromSeconds(10));
}

Example 3: Export a Workbook to a Memory Stream

C#
Telerik.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Documents.Spreadsheet.Model.Workbook();
workbook.Worksheets.Add();

Telerik.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider formatProvider = new Telerik.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();

byte[] bytes;
using (MemoryStream output = new MemoryStream())
{
    formatProvider.Export(workbook, output, TimeSpan.FromSeconds(10));
    bytes = output.ToArray();
}

*This documentation is neither affiliated with, nor authorized, sponsored, or approved by, Microsoft Corporation.

See Also

In this article
ImportExportSee Also
Not finding the help you need?
Contact Support