Getting Started
Installation
Install Aspose.Cells through NuGet
NuGet is the easiest way to download and install Aspose.Cells for .NET.
- Open Microsoft Visual Studio and NuGet package manager.
- Search “aspose.cells” to find the desired Aspose.Cells for .NET.
- Click on “Install”, Aspose.Cells for .NET will be downloaded and referenced in your project.
You can also download it from the nuget web page for aspose.cells: Aspose.Cells for .NET NuGet Package
Install Aspose.Cells on windows
- Download Aspose.Cells.msi from the following page: Download Aspose.Cells.msi
- Double-click the Aspose Cells msi and follow the instructions to install it:
Install Aspose.Cells on linux
In this example, I use Ubuntu to show how to start using Aspose.Cells on linux.
- Create a .netcore application, named “AsposeCellsTest”.
- Open file “AsposeCellsTest.csproj”, add the following lines into it for Aspose.Cells package references:
<ItemGroup> <PackageReference Include="Aspose.Cells" Version="23.4" /> </ItemGroup>
- Open the project with VSCode on Ubuntu:
- run test with the following code:
Note: Aspose.Cells For .NetStandard can support your requirement on linux.
Applies to: NetStandard2.0, NetCore2.1, NetCore3.1, Net5.0, Net6.0 and advanced version.
Install Aspose.Cells on MAC OS
In this example, I use macOS High Sierra to show how to start using Aspose.Cells on MAC OS.
- Create a .netcore application, named “AsposeCellsTest”.
- Open the application with Visual Studio for Mac, then install Aspose Cells through NuGet:
- run test with the following code:
- If you need to use drawing-related features, please install libgdiplus in macOS, see: How to Install libgdiplus in macOS
Note: Aspose.Cells For .NetStandard can support your requirement on MAC OS.
Applies to: NetStandard2.0, NetCore2.1, NetCore3.1, Net5.0, Net6.0 and advanced version.
Run Aspose Cells in Docker
How to use graphics library on non-windows platforms with Net6
Aspose.Cells for Net6 now uses SkiaSharp as the graphics library, as recommended in official statement of Microsoft. For more details about using Aspose.Cells with NET6, please see How to Run Aspose.Cells for .Net6.
Creating the Hello World Application
The steps below creates the Hello World application using the Aspose.Cells API:
- If you have a license, then apply it. If you are using the evaluation version, skip the license related code lines.
- Create an instance of the Workbook class to create a new Excel file, or open an existing Excel file.
- Access any desired cell of a worksheet in the Excel file.
- Insert the words Hello World! into a cell accessed.
- Generate the modified Microsoft Excel file.
The implementation of the above steps is demonstrated in the examples below.
Code Sample: Creating a New Workbook
The following example creates a new workbook from the scratch, inserts “Hello World!” into cell A1 in the first worksheet and saves as Excel file.
Code Sample: Opening an Existing File
The following example opens an existing Microsoft Excel template file “Sample.xlsx”, inserts “Hello World!” into cell A1 in the first worksheet and saves as Excel file.