Product Family

Insert PivotTable in XLSM Documents via C#

Native and high performance Microsoft Excel XLSM spreadsheet with PivotTable creation programmatically using server side .NET APIs.

Generating MS Excel XLSM file with PivotTable dynamically within running application is easy. In order to create XLSM documents with PivotTable from scratch without requiring MS Office, we’ll use Aspose.Cells for .NET API that offers different features for spreadsheets creation, manipulation and conversion using .NET platform. Developers can easily enhance code for writing data, generating charts or graphs as well as creating table in spreadsheets.

How to insert PivotTable in XLSM via C#

It is easy for the developers to insert PivotTable in XLSM format spreadsheet within running different reporting applications for data processing in just a few lines of code.

  1. Include the namespace in your class file
  2. Create Workbook class instance.
  3. Access the first worksheet of the workbook.
  4. Get the desired cell(s) of the worksheet and put the value in the cell(s).
  5. Insert PivotTable and set the style
  6. Use Save method to save the workbook as XLSM file.

System Requirements

Just make sure that system have Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms as well as development environment like Microsoft Visual Studio.

  • Install from command line as nuget install Aspose.Cells or via Package Manager Console of Visual Studio with Install-Package Aspose.Cells.
  • Alternatively, get the offline MSI installer or all DLLs in a ZIP file from downloads

Insert PivotTable in XLSM - C#

An Excel Spreadsheet Programming Library capable of building cross-platform applications with the ability to generate, modify, convert, render and print Excel XLSM files. .NET Excel API not only convert between spreadsheet formats, it can also render Excel files as images, PDF, HTML, ODS and more, thus making it a perfect choice to exchange documents in industry-standard formats.

XLSM What is XLSM File Format?

Files with XLSM extension is a type of Spreadsheet files that support Macros. From application point of view, a Macro is set of instructions that are used for automating processes. A macro is used to record the steps that are performed repeatedly and facilitates performing the actions by running the macro again. Macros are programmed with Microsoft’s Visual Basic for Applications (VBA) from within the Excel Workbook using the Visual Basic Editor and can be run/debug directly from there.

Read More

Other Supported PivotTable Formats

You can also create other Microsoft Excel formats with PivotTable including few listed below.

XLS (Microsoft Excel Spreadsheet (Legacy))
XLSX (Open XML Workbook)
XLSB (Excel Binary Workbook)
XLSM (Macro-enabled Spreadsheet)