---
title: "read_calc_chain"
---

[< Back to Reference](../reference.qmd) | [View source](https://codeberg.org/usrbinr/tidychain/src/branch/main/R/read_calc_chain.R#L28)

# `read_calc_chain()`

Read and Parse Excel calcChain.xml (Internal)

## Usage

```r
read_calc_chain(path)
```

## Arguments

| Argument | Description |
|----------|-------------|
| `path` | Path to an .xlsx file. |

## Value

A calc_chain object containing the parsed calculation chain,
sheet mappings, and file metadata.

## Description

Extracts and parses the calcChain.xml file from an Excel workbook (.xlsx).
The calculation chain records the order in which formulas were created,
which can reveal if rows have been moved or manipulated.

This is an internal function. Use `parse_xlsx()` instead.

## Details

The calcChain.xml file contains <c> elements with the following attributes:

- `r`: Cell reference (e.g., "A1", "B5")

- `i`: Sheet ID (inherits from previous if omitted)

- `s`: In child chain flag (inherits from previous if omitted)

- `l`: New dependency level flag

- `t`: New thread flag

- `a`: Array formula flag

The order of cells in calcChain.xml reflects when formulas were *created*,
not their current row position. This is the key insight for forensic analysis.

