Does excel worksheet have unique ID?

  • Thread starter Thread starter valk
  • Start date Start date
V

valk

I writing special addin for excel, that can insert some controls into
worksheet cells.
I can identificate control by cell andress,SheetName and Workbook
name..
But in case two workbooks have identical names and worksheets have
identical names too i have a problem..
The question is: is it possible to know unique id of
workbook(worksheet)?
:confused:

Thank you.
Sorry for my english..
Valentin Kovalski.
 
Yes, worksheets have unique ids, as well as unique names. You cannot
have two sheets with the same name.

Mangesh
 
No, there is no UID as such. They have an index, but that is only relative
to the workbook.

If you need such a thing, you will need to build it.
 
Two workbooks can have same names of worksheets! When its opened both
can't identificate my control.
I am already found, that range have ID, but that property doesn't sav
with workbook.
How to get Worksheet ID? It doesn't have that property.

Thank you for help
 
A single instance of Excel does not let you open two worksheets with the
same name, so no issue. If you had two instances of Excel open, they
couldn't refer to one another without some fancy API code I suspect, so no
issue either.
 
You could refer to each sheet, by its parent workbook. Something like:
Workbooks("file_name").Worksheets("Sheet1")

Manges
 
I believe you mean workbooks rather than worksheets.

For the OP, Just to summarize:

A single instance of Excel will not permit two workbooks to be open that
have identical names.

Likewise, within a single workbook, you can not have two sheets with
identical names. You can have duplicate sheet names within open workbooks,
however. Both workbookA and WorkbookB can have a sheet named Sheet1.
However, the full reference (not name) to the sheet would include the
workbook, so there would be no confusion.
 
Yep, meant workbooks ... all niter.

B.
Tom Ogilvy said:
I believe you mean workbooks rather than worksheets.

For the OP, Just to summarize:

A single instance of Excel will not permit two workbooks to be open that
have identical names.

Likewise, within a single workbook, you can not have two sheets with
identical names. You can have duplicate sheet names within open
workbooks,
however. Both workbookA and WorkbookB can have a sheet named Sheet1.
However, the full reference (not name) to the sheet would include the
workbook, so there would be no confusion.
 
We've all been in that "other place" at one time or another in our
lives..........

:-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top