Skip to content

This content is for v1.x (Discontinued). Switch to the Stable version.

The library is available on NuGet. You can install it using the following command

Terminal window
#Using Package Manager
Install-Package OpenXMLOffice
Terminal window
# For Pre Release
dotnet add package OpenXMLOffice.Presentation
Terminal window
# For Pre Release
dotnet add package OpenXMLOffice.Presentation --prerelease
Terminal window
#Using .NET CLI
dotnet add package OpenXMLOffice.Excel
Terminal window
# For Pre Release
dotnet add package OpenXMLOffice.Excel--prerelease

The official release NuGet packages for OpenXMLOffice on NuGet.org:

PackageMaintananceCurrent Stable VersionCurrent Alpha Version
OpenXMLOffice.PresentationNot ActiveNuGetNuGet
OpenXMLOffice.ExcelNot ActiveNuGetNuGet
OpenXMLOffice.DocumentNot ActiveNuGetNuGet

Once Installed the package should be direct use availabel like below example. More samples can be seen in test project’s of the repo or check other parts of the documents

using OpenXMLOffice.Presentation;
public static main(){
PowerPoint powerPoint = new(string.Format("../../test-{0}.pptx", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")), null);
powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK);
powerPoint.save();
}
using OpenXMLOffice.Excel;
public static main(){
Spreadsheet spreadsheet = new(string.Format("../../test-{0}.xlsx", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")));
spreadsheet.AddSheet("Sheet1");
spreadsheet.save();
}