Aspose.Cells FOSS for .NET adalah perpustakaan open-source gratis berlisensi MIT untuk bekerja dengan file spreadsheet Excel dalam aplikasi .NET. Instal dengan satu perintah dotnet add package Aspose.Cells_FOSS dan mulai membuat workbook, membaca sel, menerapkan gaya, menambahkan pemformatan bersyarat, hyperlink, validasi data, dan auto‑filter — semuanya tanpa memerlukan Microsoft Excel atau perpustakaan Office native apa pun.
Perpustakaan ini menyediakan API bersih yang dibangun di sekitar Workbook, Worksheet, Cells, dan Cell — objek yang familiar bagi setiap pengembang spreadsheet. Buat sebuah Workbook untuk memuat file .xlsx yang ada atau membuat yang kosong, akses worksheet melalui koleksi Worksheets, baca dan tulis nilai sel dengan PutValue, dan terapkan gaya melalui GetStyle()/SetStyle(). Rumus disimpan persis sebagai string dan dievaluasi oleh penampil saat dibuka, bukan oleh perpustakaan pada waktu runtime.
Karena perpustakaan ini merupakan kode .NET murni yang dikelola tanpa dependensi native, ia berjalan identik di Windows, macOS, Linux, kontainer Docker, dan lingkungan serverless seperti Azure Functions dan AWS Lambda. Lisensi MIT mengizinkan penggunaan komersial tanpa batas dengan tidak ada royalti, lisensi per seat, atau biaya per penyebaran.
Workbook(fileName) and Save(fileName).string, int, bool, decimal, and DateTime values with Cell.PutValue(value).Cell.StringValue, Cell.Value, and Cell.IntValue.Cell.Formula — evaluated by Excel on open.Workbook.Worksheets..xlsx without Office.CellStyle.Font.CellStyle.ForegroundColor and FillPattern.Solid.FormatConditionType.CellValue, Expression, ColorScale, DataBar, and IconSet rules via Worksheet.ConditionalFormattings.StyleRepository.Normalize(style) for consistent style application.ValidationCollection.Add().OperatorType.Between, GreaterThan, LessThan, and others.ValidationType.WholeNumber, Decimal, List, Date, or Custom.AutoFilter and AutoFilter.FilterColumns.CellArea.CreateCellArea(start, end).HyperlinkCollection.Add().DefinedNameCollection.Add().WorkbookProtection.Worksheet.Protect().LoadDiagnostics and LoadIssue.Install the NuGet package, then create a Workbook, access the first Worksheet, and write values to cells using PutValue. The example demonstrates writing multiple value types and performing a save-and-reload round trip.
dotnet add package Aspose.Cells_FOSS
using Aspose.Cells_FOSS;
var outputPath = "cell-data-roundtrip.xlsx";
var workbook = new Workbook();
var sheet = workbook.Worksheets[0];
sheet.Cells["A1"].PutValue("Hello");
sheet.Cells["B1"].PutValue(123);
sheet.Cells["C1"].PutValue(true);
sheet.Cells["D1"].PutValue(12.5m);
sheet.Cells["F1"].PutValue(10);
sheet.Cells["G1"].Formula = "=F1*2";
workbook.Save(outputPath);
var loaded = new Workbook(outputPath);
var loadedSheet = loaded.Worksheets[0];
Console.WriteLine(loadedSheet.Cells["A1"].StringValue);
Console.WriteLine(loadedSheet.Cells["G1"].Formula);
Add conditional formatting rules to highlight cell ranges. The example applies a between-value rule with a solid fill, an expression rule, a color scale, a data bar, and an icon set.
using Aspose.Cells_FOSS;
var workbook = new Workbook();
var sheet = workbook.Worksheets[0];
sheet.Name = "Conditional Formatting";
for (var i = 0; i < 10; i++)
sheet.Cells[i, 0].PutValue(i + 1);
var cfCol = sheet.ConditionalFormattings[sheet.ConditionalFormattings.Add()];
cfCol.AddArea(CellArea.CreateCellArea("A1", "A10"));
var rule = cfCol[cfCol.AddCondition(FormatConditionType.CellValue,
OperatorType.Between, "3", "7")];
var style = rule.Style;
style.Pattern = FillPattern.Solid;
style.ForegroundColor = Color.FromArgb(255, 255, 199, 206);
style.Font.Bold = true;
rule.Style = style;
workbook.Save("conditional-formatting.xlsx");
Create external and internal hyperlinks, then define named ranges scoped to the workbook or a specific sheet.
using Aspose.Cells_FOSS;
var workbook = new Workbook();
var sheet = workbook.Worksheets[0];
sheet.Name = "Links";
sheet.Cells["A1"].PutValue("Docs");
var link = sheet.Hyperlinks[sheet.Hyperlinks.Add("A1", 1, 1, "https://example.com/docs")];
link.TextToDisplay = "Docs";
link.ScreenTip = "External docs";
var name = workbook.DefinedNames[workbook.DefinedNames.Add("GlobalRange", "='Links'!$A$1:$D$5")];
name.Comment = "Primary sample range";
workbook.Save("hyperlinks-and-names.xlsx");
It is a free, MIT-licensed open-source .NET library for creating, reading, modifying, and saving Excel .xlsx workbooks without requiring Microsoft Office.
XLSX is the only supported read/write format. XLS, CSV, ODS, PDF, HTML, and image export are not available in this edition.
No. Aspose.Cells FOSS is pure managed .NET code with no COM, P/Invoke, Office Interop, or native library dependencies.
Run dotnet add package Aspose.Cells_FOSS. The library requires .NET 6.0 or later. There are no native extensions to compile.
Formula strings are stored and retrieved verbatim. The library does not perform server-side recalculation — formulas are evaluated by Excel or a compatible application on open.
Yes. The MIT License permits unrestricted commercial use with no royalties, seat licenses, or per-deployment fees.