Install Aspose Cells through NuGet
NuGet is the easiest way to download and install Aspose.Cells for C++.
- Create a Microsoft Visual Studio project for C++.
- Include header file “Aspose.Cells.h”.
- Open Microsoft Visual Studio and NuGet package manager.
- Search “aspose.cells.cpp” to find the desired Aspose.Cells for C++.
- Click on “Install”, Aspose.Cells for C++ will be downloaded and referenced in your project.
You can also download it from the nuget web page for aspose.cells: Aspose.Cells for C++ NuGet Package
A demo for using Aspose.Cells for C++ on Windows
- Download Aspose.Cells for C++ from the following page: Download Aspose.Cells for C++(Windows)
- Unzip the package and you will find a Demo which is on how to use Aspose.Cells for C++.
- Open the Demo.sln with Visual Studio 2017 or higher version
- main.cpp: this file shows how to code to test Aspose.Cells for C++
- sourceFile/resultFile: these two folders are storage directories used in main.cpp
How to use Aspose.Cells for C++ on Linux OS
- Download Aspose.Cells for C++ from the following page: Download Aspose.Cells for C++(Linux)
- Unzip the package and you will find a Demo which is on how to use Aspose.Cells for C++ for Linux.
- Run “cd Demo” in your Linux command line
- Run “rm -rf build;mkdir build;cd build”
- Run “cmake ..” will create a Makefile by CMakeLists.txt in Demo folder
- Run “make” to compile
- Run “./demo” you will see the result
Creating the Hello World Application
The steps below creates the Hello World application using the Aspose.Cells API:
- Create an instance of the Workbook class.
- If you have a license, then apply it. If you are using the evaluation version, skip the license related code lines.
- 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 on the first worksheet and saves the Excel file.
Code Sample: Opening an Existing File
The following example opens an existing Microsoft Excel template file, gets a cell and checks the value in the cell A1.