ImportExcel icon indicating copy to clipboard operation
ImportExcel copied to clipboard

Cannot read named cell added with Add-ExcelName

Open feardamhan opened this issue 9 months ago • 3 comments

Perhaps I’m doing something wrong but after I add a named cell it doesn’t seem like I can read it back afterward.

When I open the file in excel the name has been applied to the cell and the value I placed in it is there but when I do

$workbook.workbook.names[“added_name”] I get nothing back.

Names added manually in excel can be retrieved fine this way

Is this a bug?

feardamhan avatar Apr 18 '25 16:04 feardamhan

pls post a short repro of this

dfinke avatar Apr 18 '25 21:04 dfinke

Hope this helps

Basic file before manipulation via PS (One sheet, one named cell) image

Commands issued: image

Cannot access the named cell

But if I open the file I can see this: image

feardamhan avatar Apr 18 '25 22:04 feardamhan

EPPlus does not update app.xml file in openxml definition, that's why Excel can see ps_created_name range name which is present in workbook.xml file, but EPPlus cannot. This is definitely a bug that cannot be fixed in simple way. Also EPPlus cannot set a range name scope.

UPDATE

If you create all range names programmatically a folder docProps is not created at all

scriptingstudio avatar Apr 20 '25 13:04 scriptingstudio

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 27 '25 02:06 stale[bot]