Tracing Precedents in Excel using C#

This tutorial guides on tracing precedents in Excel using C#. It has the IDE settings, steps depicting the program flow, and a running sample code to identify dependent and precedent in Excel using C#. The sample code will create a new Excel file and demonstrate the complete process of creating and accessing the dependents and precedents.

Steps for Tracking Precedents and Dependents in Excel with C#

  1. Set the environment to use Aspose.Cells for .NET to track precedents and dependents
  2. Create an empty Excel file using the Workbook class for analyzing precedents and dependents
  3. Mark some cells as dependent and precedent and set the formula in the dependent cell accordingly
  4. Access the collection of precedents from the dependent cell
  5. Iterate through all the precedents and display basic information
  6. Get the collection of dependents from any precedent cell and display the information

These steps summarize the process to identify the dependents and precedents in Excel using C#. Create an empty workbook, set a formula in a cell, and access the precedents collection from the cell where you have set the formula. Similarly, get the list of dependents for the cell used in the formula to understand how to retrieve the information of the dependent cells.

Code to Identify Precedents and Dependents in Excel with C#

The sample code demonstrates how to track Excel dependent cells using C# and precedent cells. The precedent collection contains the referred area collection as a formula that encompasses a range or set of cells, while any precedent cell contains a collection of individual cells that depend on it.

This article has taught us the concept of tracing dependents and precedents in Excel. For displaying the document properties, refer to the article on Display document properties in Excel using C#.

 English