excel-backup-manager
Excel Backup Manager Skill
Safe Excel file backup and restore functionality
Overview
This skill automates Excel file backup management following CLAUDE.md safety protocols.
Key features:
- Automatic timestamped backups:
file.xlsm→file.backup.20251211_143000.xlsm - Backup listing: View all available backups
- Selective restore: Restore from any previous backup
- Cleanup: Remove old backups while preserving recent ones
When to Use
- Before modifying VBA code: Always create a backup first
- After errors: Restore from a previous working version
- Testing Excel changes: Keep safe checkpoints
- Data protection: Prevent accidental data loss
- Auditing: Track modification history
Usage
# Create a backup
conda run -n excel python script/backup_excel.py backup perturb_inform.xlsm
# List all backups
conda run -n excel python script/backup_excel.py list perturb_inform.xlsm
# Restore from backup
conda run -n excel python script/backup_excel.py restore file.backup.20251211_143000.xlsm
# Clean up old backups (keep 5 most recent)
conda run -n excel python script/backup_excel.py cleanup perturb_inform.xlsm --keep 5
Output
Backup Command
Creates backup in same directory:
perturb_inform.backup.20251211_143000.xlsm
List Command
Shows all backups with sizes and timestamps:
Available backups for perturb_inform.xlsm:
1. perturb_inform.backup.20251211_143000.xlsm (170.5 KB) - 2025-12-11 14:30:00
2. perturb_inform.backup.20251211_140000.xlsm (170.5 KB) - 2025-12-11 14:00:00
3. perturb_inform.backup.20251210_180000.xlsm (170.3 KB) - 2025-12-10 18:00:00
Cleanup Command
Removes old backups, keeps specified count:
✓ Removed 3 old backups
✓ Keeping 5 most recent backups
Integration with VBA Modification
from backup_manager import create_backup
# Always backup before modifying
backup_file = create_backup('perturb_inform.xlsm')
# backup_file = 'perturb_inform.backup.20251211_143000.xlsm'
# Now safe to modify VBA
try:
modify_vba_code(...)
except Exception as e:
restore_backup(backup_file) # Rollback if failed
Files
backup_manager.py: Core backup logic- CLI:
script/backup_excel.py
Related Skills
excel-vba-modifier: Uses backups for safetyexcel-inspector: Analyze before backup
Safety Features
✓ Timestamped naming prevents collisions ✓ Backup verification (file integrity check) ✓ Automatic cleanup (configurable retention) ✓ No overwrites (immutable backups) ✓ Works with any .xlsx/.xlsm files
More from rukkha1024/elderly-balance-assessment
excel-vba-modifier
Safely modify Excel VBA code using xlwings. Checks Trust Center permissions, reads/writes modules, and runs test macros. Always creates backups before modifications.
19excel-inspector
Inspect Excel file structure (sheets, data types, VBA code) to help AI understand the workbook before writing code. Use when you need to understand an Excel file's schema, analyze data structure, or extract VBA code for modification.
9playwright-excel
Integrate Excel (.xlsx) data into Playwright codegen scripts by replacing hardcoded values with config-driven lookups, loading data with polars, and validating every step with Playwright MCP (start MCP from the repo if not running). Use for Playwright automation updates that require Excel-backed data, config.yaml centralization, or MCP validation/reporting.
9excel-na-utils
Helper functions for NA/missing value handling in Excel data. Provides Python and VBA implementations following CLAUDE.md NA handling guidelines.
8