Frequently Asked Questions
Frequently Asked Questions
Licensing & Open Source
What is the license for Aspose.Cells FOSS for .NET?
Aspose.Cells FOSS for .NET is published under the MIT License. You are free to use, copy, modify, and distribute the library in any project — including commercial software — without royalties or attribution requirements beyond the license notice. Source code is available at github.com/aspose-cells-foss/Aspose.Cells-FOSS-for-NET.
Can I use Aspose.Cells FOSS for .NET in a commercial product?
Yes. The MIT License permits unrestricted commercial use. There are no seat limits, runtime fees, or subscription requirements.
Is this the same as the commercial Aspose.Cells for .NET?
No. Aspose.Cells FOSS is a separate, independent open-source library. It supports XLSX read/write only. The commercial Aspose.Cells for .NET supports many additional formats (XLS, ODS, PDF, HTML, etc.) and features that are outside the scope of this FOSS release.
Installation & Requirements
How do I install Aspose.Cells FOSS for .NET?
Install via the dotnet CLI:
dotnet add package Aspose.Cells_FOSSOr through the Visual Studio Package Manager Console:
Install-Package Aspose.Cells_FOSSWhat .NET versions are supported?
.NET 6.0 or later (.NET 8.0 LTS is recommended). The library is pure managed code and does not target .NET Framework.
Are there any native dependencies?
No. Aspose.Cells FOSS for .NET is pure managed code with no COM, P/Invoke, Office Interop, or native library dependencies. It runs on Windows, macOS, Linux, Docker, and serverless environments.
Format Support
Which file formats can Aspose.Cells FOSS for .NET read and write?
| Format | Extension | Read | Write |
|---|---|---|---|
| Xlsx | .xlsx | ✓ | ✓ |
Can the library read or write CSV, XLS, ODS, or PDF files?
No. Only XLSX (Open XML) is supported in this release. CSV, binary XLS, ODS, PDF, HTML, and image export are not available.
Can I load an XLSX file that is slightly corrupt?
Yes. Pass a LoadOptions object with TryRepairPackage = true and TryRepairXml = true to the Workbook constructor. The library will attempt to recover the file. A WorkbookLoadException is thrown if the file is unrecoverable.
using Aspose.Cells_FOSS;
var opts = new LoadOptions { TryRepairPackage = true, TryRepairXml = true };
var wb = new Workbook("file.xlsx", opts);
Console.WriteLine("Repairs applied: " + wb.LoadDiagnostics.HasRepairs);API Usage
How do I create a new workbook and write cell data?
Instantiate Workbook, access the first worksheet via Workbook.Worksheets[0], and call Cell.PutValue() to write data. Save with Workbook.Save(path).
using Aspose.Cells_FOSS;
var wb = new Workbook();
var ws = wb.Worksheets[0];
ws.Cells["A1"].PutValue("Name");
ws.Cells["B1"].PutValue("Score");
ws.Cells["A2"].PutValue("Alice");
ws.Cells["B2"].PutValue(95);
ws.Cells["C2"].Formula = "=B2*1.1";
wb.Save("output.xlsx");How do I read cell values from an existing XLSX file?
Pass the file path to the Workbook constructor and read cell values through Cell.StringValue (display string) or Cell.Value (raw .NET object).
using Aspose.Cells_FOSS;
var wb = new Workbook("output.xlsx");
var ws = wb.Worksheets[0];
Console.WriteLine(ws.Cells["A2"].StringValue); // Alice
Console.WriteLine(ws.Cells["B2"].StringValue); // 95
Console.WriteLine(ws.Cells["C2"].Formula); // =B2*1.1How do I apply styling to a cell?
Call Cell.GetStyle() to retrieve the current Style, modify properties, and call Cell.SetStyle(style) to apply them.
using Aspose.Cells_FOSS;
var wb = new Workbook();
var cell = wb.Worksheets[0].Cells["A1"];
cell.PutValue("Header");
var style = cell.GetStyle();
style.Font.Bold = true;
style.Font.Size = 14;
style.Pattern = FillPattern.Solid;
style.ForegroundColor = System.Drawing.Color.FromArgb(255, 198, 239, 206);
style.HorizontalAlignment = HorizontalAlignmentType.Center;
cell.SetStyle(style);
wb.Save("styled.xlsx");How do I add a new worksheet?
Call Workbook.Worksheets.Add(name). The method returns the integer index of the new sheet; use it to access the sheet object.
using Aspose.Cells_FOSS;
var wb = new Workbook();
wb.Worksheets[0].Name = "Summary";
var dataIdx = wb.Worksheets.Add("Data");
wb.Worksheets[dataIdx].Cells["A1"].PutValue("Data sheet");
wb.Save("multi.xlsx");How do I add data validation to a cell range?
Access Worksheet.Validations, call Add(CellArea) to create a Validation, then set its Type using ValidationType.
using Aspose.Cells_FOSS;
var wb = new Workbook();
var ws = wb.Worksheets[0];
var val = ws.Validations[ws.Validations.Add(CellArea.CreateCellArea("A1", "A10"))];
val.Type = ValidationType.List;
val.Formula1 = "\"Open,Closed,Pending\"";
val.InCellDropDown = true;
wb.Save("validated.xlsx");Known Limitations
What features are not supported?
The following are outside the current scope of Aspose.Cells FOSS for .NET:
- Formats other than XLSX (no XLS, CSV, ODS, PDF, HTML, or image export)
- Pivot tables and pivot charts
- VBA macros
- Sparklines
- Rich text within a single cell (mixed font runs)
Does the library support formula recalculation?
Formula strings are stored and retrieved verbatim. Calculated values are read from the cached result stored in the XLSX file. The library does not perform server-side formula recalculation — the formula is recalculated by Excel or a compatible application on open.
Can I protect a workbook with a password?
Worksheet-level protection is available through Worksheet.Protect() and Worksheet.Protection. Workbook-level password encryption is not in the current API surface.