Does Excel Have a Unique Workbook Instance ID?
Question details
The user wants to know if the Excel file format or Office JavaScript API provides a supported unique workbook identifier that automatically updates when a file is copied or saved as a new file.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Developing add-ins or tracking unique individual workbook files across a system.
- Observed behavior
- Excel duplicates internal identifiers, such as custom properties and XML parts, when a workbook is copied or saved as a new file, preventing native unique instance tracking.
Understand that any data stored directly within the structure of an Excel file will inevitably be duplicated if a user creates a copy of that file at the operating system level.
Use External Identity Services or File Metadata
Since native Excel files duplicate internal IDs on copying, developers must rely on external storage or file-system metadata to assign and track unique workbook instances.
The Excel file format and the Office JavaScript API do not provide a native workbook identifier that automatically changes when a workbook is duplicated. Because a copied file is essentially a byte-for-byte clone, any internally generated IDs, named ranges, custom properties, or custom XML parts are duplicated alongside the file contents.
To reliably track unique instances of a workbook, developers must externalize the identifier generation and validation.
If your workbooks are hosted on platforms like SharePoint or OneDrive, use the platform's native file metadata (such as a SharePoint Item ID). These platforms automatically assign a new, unique ID to a file when a copy is created.
Set up an external database for your application or add-in. When a workbook is opened, make an API call to your database to register the file or its current file path, and assign it a unique session or instance ID externally.
Use the document's URL or local file path as a temporary unique identifier. Two separate files cannot share the exact same path on the same system simultaneously, making it a reliable differentiator for active sessions.

Try WPS Office for Your Spreadsheet Needs
While managing unique file tracking can be complex across various spreadsheet APIs, WPS Office offers a highly compatible, free, and lightweight alternative for everyday spreadsheet management and data analysis.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the downloaded installer and follow the on-screen instructions to set up WPS Office on your device.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheets and seamlessly open your existing .xlsx files without worrying about formatting loss.

Frequently Asked Questions
Can I use custom document properties as a unique workbook ID?
No. Custom document properties are embedded within the workbook's file structure. When the workbook is copied or saved as a new file, these properties are duplicated exactly, resulting in identical IDs across the copies.
Does a generated GUID in a hidden sheet work for tracking copies?
While you can generate a GUID and store it in a hidden sheet or named range, it will not automatically change if the user copies the file in their file explorer. The copied file will contain the exact same GUID.
Will using 'Save As' generate a new internal ID for the Excel file?
No. Using 'Save As' generally replicates the existing internal file package structure. This means all embedded metadata, custom XML parts, and internal tags remain identical to the original workbook.




