Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b910a1e
Add example: load-an-xlsx-workbook-from-a-file-stream-and-enable-auto…
agent-aspose-cells-examples May 20, 2026
774cd8a
Add example: load-a-csv-file-into-a-workbook-specify-the-delimiter-an…
agent-aspose-cells-examples May 20, 2026
33365c0
Add example: load-a-workbook-from-a-memory-stream-modify-a-cell-value…
agent-aspose-cells-examples May 20, 2026
2c0f667
Add example: create-a-shared-workbook-instance-and-configure-it-for-c…
agent-aspose-cells-examples May 20, 2026
0459e47
Add example: set-workbook-calculation-engine-to-use-multithreaded-pro…
agent-aspose-cells-examples May 20, 2026
fcfc364
Add example: enable-iterative-calculation-mode-and-set-maximum-iterat…
agent-aspose-cells-examples May 20, 2026
b0891d4
Add example: add-a-custom-xml-part-containing-metadata-and-retrieve-i…
agent-aspose-cells-examples May 20, 2026
c07852e
Add example: add-a-custom-document-property-named-projectversion-and-…
agent-aspose-cells-examples May 20, 2026
83c593a
Add example: add-a-comment-to-a-cell-with-author-information-and-disp…
agent-aspose-cells-examples May 20, 2026
8e6c7b1
Add example: merge-cells-in-a-header-row-apply-bold-font-and-center-t…
agent-aspose-cells-examples May 20, 2026
15f4a72
Add example: apply-conditional-formatting-to-highlight-cells-containi…
agent-aspose-cells-examples May 20, 2026
1013c19
Add example: apply-data-validation-to-restrict-input-to-a-list-of-pre…
agent-aspose-cells-examples May 20, 2026
7904303
Add example: set-page-margins-to-narrow-values-and-configure-the-work…
agent-aspose-cells-examples May 20, 2026
0efe2a6
Add example: protect-the-workbook-with-a-password-and-allow-only-read…
agent-aspose-cells-examples May 20, 2026
0d2bd1d
Add example: copy-a-worksheet-from-the-source-workbook-to-a-destinati…
agent-aspose-cells-examples May 20, 2026
3e55e59
Add example: move-a-worksheet-to-a-new-position-within-the-same-workb…
agent-aspose-cells-examples May 20, 2026
61dbd41
Add example: create-a-named-range-that-spans-multiple-worksheets-and-…
agent-aspose-cells-examples May 20, 2026
cc50a6d
Add example: create-a-pivot-table-from-a-data-source-range-and-place-…
agent-aspose-cells-examples May 20, 2026
c3b56cd
Add example: add-a-chart-to-a-worksheet-based-on-a-data-range-and-cus…
agent-aspose-cells-examples May 20, 2026
ac60fd1
Add example: insert-a-hyperlink-into-a-cell-that-points-to-an-externa…
agent-aspose-cells-examples May 20, 2026
d12809a
Add example: replace-all-occurrences-of-a-placeholder-string-using-a-…
agent-aspose-cells-examples May 20, 2026
897e16c
Add example: search-for-dates-matching-a-pattern-and-reformat-them-to…
agent-aspose-cells-examples May 20, 2026
65290e4
Add example: validate-all-formulas-in-the-workbook-for-errors-and-gen…
agent-aspose-cells-examples May 20, 2026
f4ca637
Add example: export-a-specific-worksheet-to-an-image-file-with-300-dp…
agent-aspose-cells-examples May 20, 2026
74e6fe7
Add example: export-the-workbook-to-pdf-format-with-high-resolution-i…
agent-aspose-cells-examples May 20, 2026
da67b2b
Add example: set-workbook-theme-to-a-builtin-style-and-update-all-cel…
agent-aspose-cells-examples May 20, 2026
de025fa
Add example: use-workbookloadoptions-to-open-a-passwordprotected-file…
agent-aspose-cells-examples May 20, 2026
a1b1340
Add example: add-a-new-contenttypeproperty-named-projectid-with-a-str…
agent-aspose-cells-examples May 20, 2026
ef140f3
Add example: mark-the-newly-added-projectid-property-as-optional-by-s…
agent-aspose-cells-examples May 20, 2026
39204d6
Add example: create-a-custom-xml-part-containing-a-book-catalog-schem…
agent-aspose-cells-examples May 20, 2026
cb0fc16
Add example: add-multiple-custom-xml-parts-representing-different-dat…
agent-aspose-cells-examples May 20, 2026
0f97b33
Add example: configure-the-workbook-to-use-a-specific-culture-when-fo…
agent-aspose-cells-examples May 20, 2026
0254b3b
Add example: load-a-workbook-that-contains-numerous-unused-styles-and…
agent-aspose-cells-examples May 20, 2026
401b1bb
Add example: measure-the-file-size-before-and-after-removing-unused-s…
agent-aspose-cells-examples May 20, 2026
7169ae5
Add example: combine-adding-custom-xml-parts-with-style-cleanup-in-a-…
agent-aspose-cells-examples May 20, 2026
9d3fead
Add example: open-the-saved-xlsx-file-as-a-zip-archive-and-verify-the…
agent-aspose-cells-examples May 20, 2026
75f3580
Add example: validate-that-each-saved-workbook-contains-the-expected-…
agent-aspose-cells-examples May 20, 2026
cbd21ed
Add example: after-adding-custom-properties-verify-that-the-workbooks…
agent-aspose-cells-examples May 20, 2026
8c11460
Add example: export-a-list-of-all-contenttypeproperty-names-from-a-wo…
agent-aspose-cells-examples May 20, 2026
443d9bc
Add example: read-the-optional-flag-of-each-contenttypeproperty-and-g…
agent-aspose-cells-examples May 20, 2026
1e090e5
Add example: generate-a-report-listing-workbooks-that-contain-optiona…
agent-aspose-cells-examples May 20, 2026
6d9d2f7
Add example: apply-a-filter-to-process-only-workbooks-that-already-co…
agent-aspose-cells-examples May 20, 2026
f1c2b29
Add example: iterate-through-multiple-workbooks-in-a-directory-adding…
agent-aspose-cells-examples May 20, 2026
2ad3156
Add example: set-isnillable-to-true-for-the-shared-property-across-al…
agent-aspose-cells-examples May 20, 2026
c860926
Add example: create-a-reusable-method-that-adds-a-contenttypeproperty…
agent-aspose-cells-examples May 20, 2026
0505410
Add example: create-a-batch-job-that-processes-100-workbooks-adding-o…
agent-aspose-cells-examples May 20, 2026
1097dda
Add example: log-the-duration-of-each-workbooks-processing-steps-to-i…
agent-aspose-cells-examples May 20, 2026
c3a2093
Add example: implement-error-handling-to-continue-batch-processing-wh…
agent-aspose-cells-examples May 20, 2026
a2c2948
Add example: configure-workbooksettings-to-disable-automatic-style-cr…
agent-aspose-cells-examples May 20, 2026
761b854
Add example: benchmark-the-time-required-to-remove-unused-styles-from…
agent-aspose-cells-examples May 20, 2026
05e51a8
Add example: compare-two-workbooks-one-with-unused-styles-removed-and…
agent-aspose-cells-examples May 20, 2026
0dcbcad
Add example: wrap-workbook-loading-and-saving-inside-a-using-statemen…
agent-aspose-cells-examples May 20, 2026
cd963f9
Add example: after-processing-call-workbookdispose-explicitly-for-eac…
agent-aspose-cells-examples May 20, 2026
e4ef269
Add example: integrate-workbook-disposal-into-a-finally-block-to-guar…
agent-aspose-cells-examples May 20, 2026
7ff8335
Add example: implement-a-commandline-tool-that-accepts-a-file-path-ad…
agent-aspose-cells-examples May 20, 2026
0258a57
Add example: create-a-unit-test-that-asserts-the-isnillable-flag-is-t…
agent-aspose-cells-examples May 20, 2026
347987d
Add example: serialize-the-workbooks-custom-xml-part-to-a-string-and-…
agent-aspose-cells-examples May 20, 2026
8ba350f
Add example: use-a-memory-stream-to-load-a-workbook-add-metadata-and-…
agent-aspose-cells-examples May 20, 2026
7ffcb79
Update agents.md
agent-aspose-cells-examples May 31, 2026
483de0b
Resolve index.json merge conflicts with release/26.5.0
agent-aspose-cells-examples May 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 185 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -5764,6 +5764,191 @@
"file": "load-a-workbook-that-contains-numerous-unused-styles-and-invoke-removeunusedstyles-to-clean-it.cs",
"title": "Load a workbook that contains numerous unused styles and invoke RemoveUnusedStyles to clean it."
},
{
"category": "manage-workbook",
"file": "add-a-chart-to-a-worksheet-based-on-a-data-range-and-customize-its-legend-position.cs",
"title": "Add a chart to a worksheet based on a data range and customize its legend position."
},
{
"category": "manage-workbook",
"file": "add-a-comment-to-a-cell-with-author-information-and-display-it-when-the-cell-is-selected.cs",
"title": "Add a comment to a cell with author information and display it when the cell is selected."
},
{
"category": "manage-workbook",
"file": "add-a-custom-document-property-named-projectversion-and-assign-it-a-semantic-version-string.cs",
"title": "Add a custom document property named ProjectVersion and assign it a semantic version string."
},
{
"category": "manage-workbook",
"file": "add-a-custom-xml-part-containing-metadata-and-retrieve-it-later-using-its-unique-identifier.cs",
"title": "Add a custom XML part containing metadata and retrieve it later using its unique identifier."
},
{
"category": "manage-workbook",
"file": "add-a-new-contenttypeproperty-named-projectid-with-a-string-value-to-the-workbook.cs",
"title": "Add a new ContentTypeProperty named ProjectId with a string value to the workbook."
},
{
"category": "manage-workbook",
"file": "add-multiple-custom-xml-parts-representing-different-data-sections-then-verify-each-appears-in-the-customxml-folder.cs",
"title": "Add multiple custom XML parts representing different data sections, then verify each appears in the customXml folder."
},
{
"category": "manage-workbook",
"file": "after-adding-custom-properties-verify-that-the-workbooks-core-properties-remain-unchanged.cs",
"title": "After adding custom properties, verify that the workbook's core properties remain unchanged."
},
{
"category": "manage-workbook",
"file": "after-processing-call-workbookdispose-explicitly-for-each-workbook-to-release-file-handles-and-memory.cs",
"title": "After processing, call Workbook.Dispose explicitly for each workbook to release file handles and memory."
},
{
"category": "manage-workbook",
"file": "apply-a-filter-to-process-only-workbooks-that-already-contain-a-specific-custom-xml-part-before-modification.cs",
"title": "Apply a filter to process only workbooks that already contain a specific custom XML part before modification."
},
{
"category": "manage-workbook",
"file": "apply-conditional-formatting-to-highlight-cells-containing-values-greater-than-a-specified-threshold.cs",
"title": "Apply conditional formatting to highlight cells containing values greater than a specified threshold."
},
{
"category": "manage-workbook",
"file": "apply-data-validation-to-restrict-input-to-a-list-of-predefined-values-in-a-column.cs",
"title": "Apply data validation to restrict input to a list of predefined values in a column."
},
{
"category": "manage-workbook",
"file": "benchmark-the-time-required-to-remove-unused-styles-from-workbooks-of-varying-size-to-determine-scaling-behavior.cs",
"title": "Benchmark the time required to remove unused styles from workbooks of varying size to determine scaling behavior."
},
{
"category": "manage-workbook",
"file": "combine-adding-custom-xml-parts-with-style-cleanup-in-a-single-processing-pipeline-for-efficiency.cs",
"title": "Combine adding custom XML parts with style cleanup in a single processing pipeline for efficiency."
},
{
"category": "manage-workbook",
"file": "compare-two-workbooks-one-with-unused-styles-removed-and-one-without-to-evaluate-visual-consistency.cs",
"title": "Compare two workbooks, one with unused styles removed and one without, to evaluate visual consistency."
},
{
"category": "manage-workbook",
"file": "configure-the-workbook-to-use-a-specific-culture-when-formatting-optional-property-values-during-export.cs",
"title": "Configure the workbook to use a specific culture when formatting optional property values during export."
},
{
"category": "manage-workbook",
"file": "configure-workbooksettings-to-disable-automatic-style-creation-before-removing-unused-styles-for-faster-cleanup.cs",
"title": "Configure WorkbookSettings to disable automatic style creation before removing unused styles for faster cleanup."
},
{
"category": "manage-workbook",
"file": "copy-a-worksheet-from-the-source-workbook-to-a-destination-workbook-while-preserving-cell-styles.cs",
"title": "Copy a worksheet from the source workbook to a destination workbook while preserving cell styles."
},
{
"category": "manage-workbook",
"file": "create-a-batch-job-that-processes-100-workbooks-adding-optional-metadata-and-removing-unused-styles.cs",
"title": "Create a batch job that processes 100 workbooks, adding optional metadata and removing unused styles."
},
{
"category": "manage-workbook",
"file": "create-a-custom-xml-part-containing-a-book-catalog-schema-and-add-it-using-workbookcontenttypepropertiesadd.cs",
"title": "Create a custom XML part containing a book catalog schema and add it using Workbook.ContentTypeProperties.Add."
},
{
"category": "manage-workbook",
"file": "create-a-named-range-that-spans-multiple-worksheets-and-use-it-in-a-summary-formula.cs",
"title": "Create a named range that spans multiple worksheets and use it in a summary formula."
},
{
"category": "manage-workbook",
"file": "create-a-pivot-table-from-a-data-source-range-and-place-it-on-a-new-worksheet.cs",
"title": "Create a pivot table from a data source range and place it on a new worksheet."
},
{
"category": "manage-workbook",
"file": "create-a-reusable-method-that-adds-a-contenttypeproperty-and-sets-isnillable-based-on-a-boolean-parameter.cs",
"title": "Create a reusable method that adds a ContentTypeProperty and sets IsNillable based on a boolean parameter."
},
{
"category": "manage-workbook",
"file": "create-a-shared-workbook-instance-and-configure-it-for-concurrent-editing-by-multiple-users.cs",
"title": "Create a shared workbook instance and configure it for concurrent editing by multiple users."
},
{
"category": "manage-workbook",
"file": "create-a-unit-test-that-asserts-the-isnillable-flag-is-true-for-a-given-contenttypeproperty-after-saving.cs",
"title": "Create a unit test that asserts the IsNillable flag is true for a given ContentTypeProperty after saving."
},
{
"category": "manage-workbook",
"file": "enable-iterative-calculation-mode-and-set-maximum-iterations-to-improve-convergence-of-circular-formulas.cs",
"title": "Enable iterative calculation mode and set maximum iterations to improve convergence of circular formulas."
},
{
"category": "manage-workbook",
"file": "export-a-list-of-all-contenttypeproperty-names-from-a-workbook-to-a-csv-file-for-reporting.cs",
"title": "Export a list of all ContentTypeProperty names from a workbook to a CSV file for reporting."
},
{
"category": "manage-workbook",
"file": "export-a-specific-worksheet-to-an-image-file-with-300-dpi-resolution-and-transparent-background.cs",
"title": "Export a specific worksheet to an image file with 300 DPI resolution and transparent background."
},
{
"category": "manage-workbook",
"file": "export-the-workbook-to-pdf-format-with-high-resolution-images-and-embedded-fonts.cs",
"title": "Export the workbook to PDF format with high resolution images and embedded fonts."
},
{
"category": "manage-workbook",
"file": "generate-a-report-listing-workbooks-that-contain-optional-contenttypeproperties-lacking-the-isnillable-flag.cs",
"title": "Generate a report listing workbooks that contain optional ContentTypeProperties lacking the IsNillable flag."
},
{
"category": "manage-workbook",
"file": "implement-a-commandline-tool-that-accepts-a-file-path-adds-an-optional-property-and-disposes-the-workbook.cs",
"title": "Implement a command\u2011line tool that accepts a file path, adds an optional property, and disposes the workbook."
},
{
"category": "manage-workbook",
"file": "implement-error-handling-to-continue-batch-processing-when-a-workbook-fails-to-load-due-to-corruption.cs",
"title": "Implement error handling to continue batch processing when a workbook fails to load due to corruption."
},
{
"category": "manage-workbook",
"file": "insert-a-hyperlink-into-a-cell-that-points-to-an-external-website-and-opens-in-a-new-tab.cs",
"title": "Insert a hyperlink into a cell that points to an external website and opens in a new tab."
},
{
"category": "manage-workbook",
"file": "integrate-workbook-disposal-into-a-finally-block-to-guarantee-resource-release-even-when-exceptions-occur.cs",
"title": "Integrate workbook disposal into a finally block to guarantee resource release even when exceptions occur."
},
{
"category": "manage-workbook",
"file": "iterate-through-multiple-workbooks-in-a-directory-adding-a-shared-contenttypeproperty-to-each-file.cs",
"title": "Iterate through multiple workbooks in a directory, adding a shared ContentTypeProperty to each file."
},
{
"category": "manage-workbook",
"file": "load-a-csv-file-into-a-workbook-specify-the-delimiter-and-treat-the-first-row-as-headers.cs",
"title": "Load a CSV file into a workbook, specify the delimiter, and treat the first row as headers."
},
{
"category": "manage-workbook",
"file": "load-a-workbook-from-a-memory-stream-modify-a-cell-value-and-write-back-to-the-stream.cs",
"title": "Load a workbook from a memory stream, modify a cell value, and write back to the stream."
},
{
"category": "manage-workbook",
"file": "load-a-workbook-that-contains-numerous-unused-styles-and-invoke-removeunusedstyles-to-clean-it.cs",
"title": "Load a workbook that contains numerous unused styles and invoke RemoveUnusedStyles to clean it."
},
{
"category": "manage-workbook",
"file": "load-an-xlsx-workbook-from-a-file-stream-and-enable-automatic-formula-calculation.cs",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using Aspose.Cells;
using Aspose.Cells.Charts;

class Program
{
static void Main()
{
// Create a new workbook and get the first worksheet
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];

// Add sample data for the chart
sheet.Cells["A1"].PutValue("Category");
sheet.Cells["B1"].PutValue("Value");
for (int i = 2; i <= 6; i++)
{
sheet.Cells[$"A{i}"].PutValue("Item " + (i - 1));
sheet.Cells[$"B{i}"].PutValue((i - 1) * 10);
}

// Add a column chart (rows 8‑20, columns 1‑8)
int chartIndex = sheet.Charts.Add(ChartType.Column, 7, 0, 19, 7);
Chart chart = sheet.Charts[chartIndex];

// Set the data range for the chart (A1:B6) and plot by column
chart.SetChartDataRange("A1:B6", true);

// Customize the legend: place it at the bottom of the chart
chart.Legend.Position = LegendPositionType.Bottom;
chart.ShowLegend = true; // Ensure the legend is visible

// Save the workbook with the chart
workbook.Save("ChartWithBottomLegend.xlsx", SaveFormat.Xlsx);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Aspose.Cells;
using System;

class AddCommentDemo
{
static void Main()
{
// Create a new workbook
Workbook workbook = new Workbook();

// Access the first worksheet
Worksheet worksheet = workbook.Worksheets[0];

// Add a comment to cell A1 (creates the comment if it does not exist)
int commentIndex = worksheet.Comments.Add("A1");
Comment comment = worksheet.Comments[commentIndex];

// Set the author and the comment text
comment.Author = "John Doe";
comment.Note = "Reviewed by John Doe";

// Make the comment visible when the cell is selected
comment.IsVisible = true;

// Save the workbook
workbook.Save("CommentWithAuthor.xlsx");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using Aspose.Cells;
using Aspose.Cells.Properties;

class AddCustomDocumentProperty
{
static void Main()
{
// Create a new workbook
Workbook workbook = new Workbook();

// Add a custom document property named "ProjectVersion" with a semantic version string
workbook.CustomDocumentProperties.Add("ProjectVersion", "1.2.3");

// Display the added property value (optional)
Console.WriteLine("ProjectVersion: " + workbook.CustomDocumentProperties["ProjectVersion"].Value);

// Save the workbook
workbook.Save("ProjectVersionDemo.xlsx", SaveFormat.Xlsx);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Text;
using Aspose.Cells;
using Aspose.Cells.Markup;

namespace AsposeCellsCustomXmlDemo
{
class Program
{
static void Main()
{
// ---------- Create a new workbook ----------
Workbook workbook = new Workbook();

// Sample XML data to store in the custom XML part
string xmlContent = "<root><item>Sample Metadata</item></root>";
byte[] xmlBytes = Encoding.UTF8.GetBytes(xmlContent);

// Add the custom XML part (no schema data in this example)
int partIndex = workbook.CustomXmlParts.Add(xmlBytes, null);

// Retrieve the added part and assign a unique identifier (GUID)
CustomXmlPart customPart = workbook.CustomXmlParts[partIndex];
string uniqueId = Guid.NewGuid().ToString();
customPart.ID = uniqueId;

// Save the workbook containing the custom XML part
string filePath = "CustomXmlDemo.xlsx";
workbook.Save(filePath);

// ---------- Load the workbook and retrieve the custom XML part ----------
Workbook loadedWorkbook = new Workbook(filePath);

// Use the unique identifier to locate the custom XML part
CustomXmlPart retrievedPart = loadedWorkbook.CustomXmlParts.SelectByID(uniqueId);

// Output verification information
if (retrievedPart != null)
{
Console.WriteLine("Retrieved Part ID: " + retrievedPart.ID);
string retrievedXml = Encoding.UTF8.GetString(retrievedPart.Data);
Console.WriteLine("Retrieved XML Content: " + retrievedXml);
}
else
{
Console.WriteLine("Custom XML part with ID not found.");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using Aspose.Cells;
using Aspose.Cells.Properties;

class Program
{
static void Main()
{
// Create a new workbook
Workbook workbook = new Workbook();

// Add a ContentTypeProperty named "ProjectId" with a string value
// The third parameter specifies the property type; using "string" here
workbook.ContentTypeProperties.Add("ProjectId", "MyProject123", "string");

// Save the workbook to a file
workbook.Save("ProjectWorkbook.xlsx");
}
}
Loading