0

I have created an excel file (excel 2010) and set some cell names. I would like to get this name in my code with epplus lib. Worksheet has a special property for it Names but this collection is empty all the time.

var currentCell = worksheet.Cells[1, 1];

var name = worksheet.Names.SingleOrDefault(e => e.FullAddressAbsolute == currentCell.FullAddressAbsolute);

I just wonder is it issue in excel, or i need use other way to get it.

Arbejdsglæde
  • 13,141
  • 22
  • 75
  • 142

1 Answers1

0

You are probably looking in the wrong collection. Typical named ranges are actually saved in the workBOOK and not the workSHEET. See this answer:

Is there a way to get 'named' cells using EPPlus?

Community
  • 1
  • 1
Ernie S
  • 13,313
  • 2
  • 50
  • 76