Skip to content

Restore

The supported way back from a Flatten or Apply. When you run a conversion, the add-in captures an in-memory snapshot of every cell it changes; Restore writes those original formulas back. It is deliberately bounded — one level deep, the most recent run only, per workbook, and gone when you close the workbook — and it is its own button, not Excel’s Ctrl+Z, because the add-in’s programmatic writes don’t feed Excel’s native undo.

What it does

Restore undoes the most recent Flatten Names or Apply Names run for the active workbook. It walks the snapshot taken at conversion time and writes each cell’s captured original formula back — turning flattened coordinates back into the names they came from, or applied names back into the references they replaced. Like the conversions themselves, it changes only formula text, not cell values.

The snapshot model — read this once

Restore is powerful but intentionally narrow. The snapshot it relies on has firm limits, and knowing them is the difference between trusting it and being surprised by it:

  • In memory only. The snapshot lives in the running add-in’s memory. It is never written into the workbook file.
  • One level deep. There is no history stack — only the single most recent conversion can be undone.
  • Most recent only. A new Flatten/Apply doesn’t stack on top of an old snapshot; in fact a second conversion is refused while a snapshot is still active, so the one you can restore is always the last one you ran.
  • Per workbook. Each workbook has its own snapshot, keyed by its file path. Restoring acts on the workbook the snapshot was taken on.
  • Session-bound. The snapshot is discarded when you close the workbook or restart Excel. There is no cross-session recovery.

The snapshot is not saved with the file

Because it lives in memory, the snapshot does not travel with the .xlsx. Save and close the workbook, reopen it tomorrow, and Restore will be greyed out — there is nothing to restore to. If you might want the pre-conversion form back, Restore before closing — that is the only exact way back. Once the snapshot is gone, the inverse command can only approximately rebuild it (Apply Names after a flatten re-applies names where a reference still exactly matches one, but can’t recover inlined constants or unmatched references; Flatten Names after an apply re-flattens, though it normalizes references to absolute form).

When the button is enabled

Restore (keytip RN) is greyed out unless both are true: the license is active, and a snapshot exists for the active workbook. So it lights up only after you run a Flatten or Apply in this session, and goes back to greyed out once you’ve restored cleanly (or closed the workbook).

Restore is not Ctrl+Z

Use Restore — Ctrl+Z is not the recovery path

The add-in writes formulas through Excel’s object model, and those programmatic writes do not reliably populate Excel’s native undo stack — pressing Ctrl+Z after a conversion may do nothing useful, or may not bring back the named/coordinate form at all. The add-in deliberately does not hook Excel’s native undo for Name Conversion. Restore is the supported recovery path; reach for the button, not Ctrl+Z.

What Restore will and won’t overwrite

Restore is careful not to clobber work you did after converting. For each cell in the snapshot it compares the cell’s current formula against what it recorded:

  • Still the converted formula → it’s restored to the original.
  • Already back at the original → nothing to do; it’s counted as accounted-for.
  • Something else → you (or another tool) edited that cell after the conversion, so Restore skips it with “Cell formula changed since Flatten/Apply; refusing to overwrite user edits.”

It also skips cells whose sheet was renamed or deleted (“Sheet ‘X’ is no longer in the workbook (renamed or deleted)”) and any cell Excel refuses the write on — each is reported, and none aborts the rest of the restore.

Clean vs. partial restore — and why the snapshot is kept

This is the heart of the safety model. The snapshot is cleared only after a fully clean restore — every cell either written back or already at its original, with zero skips. If anything is skipped, the snapshot is preserved so you can fix the problem and run Restore again:

  • Clean restore → every cell accounted for → the snapshot is discarded and Restore greys out. Done.
  • Partial restore (something was skipped) → the snapshot stays. Fix what blocked it — unprotect a sheet, undo a stray edit, restore a renamed sheet’s name — and click Restore again. Cells already returned to the original are recognized as done, so a retry converges instead of fighting itself.

Fix-and-retry is built in

A partial restore is not a dead end. Because Restore treats cells already at their original value as accounted-for, you can resolve whatever it skipped and re-run it as many times as needed; the snapshot is only let go once the restore comes back fully clean.

Save-As in the same session

Saving a copy under a new name would normally break a path-keyed snapshot — so the add-in handles it. When a Save-As changes the file path in the current session, the snapshot is rekeyed to follow the workbook to its new name, and Restore keeps working. A plain in-place Save doesn’t change the path, so nothing needs to move.

If the snapshot can’t be matched to an open workbook

Restore only ever writes into the workbook the snapshot was actually taken on (matched by file path) — never into a renamed copy or an unrelated workbook. In the rare case it can’t find that workbook open under its recorded name, it refuses with “Could not restore: the workbook the snapshot was taken on is no longer open under its original name. This typically happens after Save-As — the snapshot was orphaned by the path change” rather than guessing. That’s the safe failure: it would rather decline than write old formulas into the wrong file.

Worked examples

SituationWhat Restore does
Clean restore. You flatten, review, then click Restore without editing anything.Every cell is written back to its named form; you’ll see something like “Restored 248 cell(s).” The snapshot is discarded and Restore greys out.
Partial restore. After flattening, you hand-edit one of the converted formulas, then Restore.The edited cell is skipped (“Cell formula changed…”); the rest are restored. The snapshot is kept — undo your edit and click Restore again to finish.
Save-As, then Restore. You flatten, do a Save-As to a new filename, then Restore.The snapshot followed the rename, so Restore writes the originals back into the saved copy as normal.
Closed and reopened. You flatten, save, close, and reopen the workbook later.Restore is unavailable — the in-memory snapshot is gone. Apply Names can rebuild names where a reference still exactly matches one, but it won’t recover inlined constants or unmatched references — a partial reconstruction, not an exact undo.

Related