Skip to content

Excel Add-in: Is there a truly unique workbook instance ID? #6437

@aldo-sanchez

Description

@aldo-sanchez

We have an excel addin written in JavaScript and have found a limitation that we'd like to know if it's truly a limitation or is not clearly understanding the Excel API.

We want to store some information in a database that we can reference via an id we assign to a named range. We want this is to be unique to the file. This means we want to store something like:

namedRangeId: 'someRandomId',
workbookUniqueId: 'anotherRandomId'

Where the workbookUniqueId is unique to the instance of the workbook, meaning if I make a copy of the workbook this id would be different. You can imagine a workflow of, open addin, get objects related to this workbook by finding by the workbookUniqueId.

So far we have not been able to find a unique id to the workbook or even produce one. When we tried producing and assigning a unique id to the workbook creating a copy of the workbook duplicates the assigned id. This makes sense, given the XML nature of Excel files. We've tried using a combination of file creation date and assigned id to no avail because created date is also copied.

We have parsed through the Excel API documentation and have not found anything that can help us achieve our goal. Do you have any idea or strategy that could help us with this?

I've posted this same question in: https://learn.microsoft.com/en-us/answers/questions/5704874/excel-add-in-is-there-a-truly-unique-workbook-inst and was recommended I ask here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions