Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readNamedRegion and Local (sheet scoped) Names ? #37

Closed
Rolf61 opened this issue Jul 25, 2014 · 4 comments · Fixed by #216
Closed

readNamedRegion and Local (sheet scoped) Names ? #37

Rolf61 opened this issue Jul 25, 2014 · 4 comments · Fixed by #216
Assignees

Comments

@Rolf61
Copy link

Rolf61 commented Jul 25, 2014

I have two sheets in my workbook. In each one a local (sheet-scoped) name "Hugo" is defined refering to the cell B2 in the specific worksheet. The values in the cells are 122 resp. 222.

getDefinedNames(wb)
[1] "Hugo" "Hugo"

readNamedRegion(wb, 'Hugo')
[1] Col1
<0 rows> (or 0-length row.names)

From my point of view it seems to be unpossible to retrieve the value 222 stored in the cell named "Hugo" in Worksheet(2) via readNamedRegion.

To reproduce the issue the following Excel Macro might be helpful:
Sub DefineNameHugoInTwoSheets()
Dim wsX As Worksheet, i As Integer, sSheetName As String, sNameName As String
For i = 1 To 2
Set wsX = Worksheets(i)
wsX.Activate
sSheetName = wsX.Name
sNameName = "Hugo"
wsX.Names.Add sNameName, "=$B$2"
wsX.Range(sNameName).Value = i * 100 + 22
Next i
End Sub

@danielkrizian
Copy link

+1

@joefogarty
Copy link

This should be possible as the sheet id is stored along with the range names in the workbook xml. There should be an additional sheet argument.

@bescoto
Copy link

bescoto commented Mar 2, 2017

+1

@woodwards
Copy link

I also would like to have the sheet names returned from the getReferenceCoordinatesFromName() function, which I think is the same issue,

@spoltier spoltier self-assigned this Mar 21, 2019
spoltier added a commit that referenced this issue Sep 11, 2019
spoltier added a commit that referenced this issue Sep 11, 2019
spoltier added a commit that referenced this issue Sep 11, 2019
spoltier added a commit that referenced this issue Sep 11, 2019
spoltier added a commit that referenced this issue Sep 11, 2019
spoltier added a commit that referenced this issue Aug 19, 2021
spoltier added a commit that referenced this issue Aug 19, 2021
spoltier added a commit that referenced this issue Aug 19, 2021
spoltier added a commit that referenced this issue Aug 19, 2021
spoltier added a commit that referenced this issue Aug 19, 2021
spoltier added a commit that referenced this issue Feb 14, 2024
spoltier added a commit that referenced this issue Feb 14, 2024
spoltier added a commit that referenced this issue Feb 14, 2024
spoltier added a commit that referenced this issue Feb 14, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 7, 2024
spoltier added a commit that referenced this issue May 15, 2024
* issue #37: add worksheetName with 'null' default

* WIP troubleshooting java xlcall method

* poi 4.1.0 update dependency jars

* Updated XLConnect jar

* POI 4.1.0 remove jar in wrong location

* POI 4.1.0 - java changes recommended in review

* POI 4.1.0: released xlconnect java

* #37: fix tests, use XLConnect java 1.0.0 + changes

* #37 updated xlconnect java

* #37: clean up code, add test case

* #37 add negative test case

* #37 documentation

* #37 fix doc of readNamedRegion

* gh #37: write in specific sheet's named region

* gh #37: create, check existence, and append to named region + tests

* gh #37 clearNamedRegion of specified worksheet

* gh #37: add clear Named region test with worksheet name

* #37 create name: set worksheet if name provided

* gh #37: sync jar, dev version

* #37 add and clean up doc

* gh#37 test: formula sheet vs scope sheet

* gh#37 fix scope v formula - sheet property in java

* #37 fix clearNamedRegion (java), cleanup, clearer doc

* gh#37: remove jcenter, seems down

* gh #37: test cloning names

* #37 fix cloning names (java)

* #37 match worksheet name strictly (Java)

* gh#37 adapt doc to strict matching

* #37 correct null check in readNamed...

* Review: null handling / default value

* Review: parameter name change to '...scope'

* Review: write Named region - WIP?

* Review: write Named region - doc

* Review: use "" for explicit global scope

* Fix doc syntax

* Review: worksheet scope for ref coordinates + doc fixes

* Review: scoped removeName, doc fix

* Review: scoped addImage, missing default

* Review - fix doc

* Review: addImage backwards compat

* addImage fix doc

* review:  dimension-abiding readNamedRegion

* Restore full clear named region check

* Test write named to file with scope vector

* Proposed fix, test change, fix read test

* Fixed test

* attributes (handling new java cls, setting attrs)

* processing attributes, working for n scopes

* jar - handle null scope in create

* Adapted attribute handling with suggested approach

* correctly set names

* clean up, ws scope attribute when null (jar)

* WIP read named region attributes

* note after discussing with Riccardo

* attribute value is array of string

* Attributes in dataframe from java

* preserve attributes in extractRowNames

* use xlconnect-java rebased - with `overwriteFormulaCells`

* Jar from rebased XLConnect-java (refactoring)

* align xlcWithAttr... with changes to xlcCall

* avoid overwriting names when setting attributes

* checkTrue instead of checkExists for bool with attributes

* test write named region using (supported) scalar formula values only

* Doc: fix argument order in writeNamedRegionToFile

* combined version of xlcCall + Attributes

* test that attributes are set on existsName

* test creating scoped names

* remove unused code, reorder lines for clarity

* define and test attributes toggle

* implement attributes toggle

* add scope param and clarify attribute handling in documentation

* writeNamedRegionToFile: handle len(formula)>1

* refactoring: align function param order

* missing in \usage of appendNamedRegion-methods

* troubleshooting LaTeX output on newer R versions (?)

* fix itemize syntax

* line break not required

* test presence attributes on dataframes

* preserve java attributes on dataframes

* test: write then read two dataframes at once

* xlc-java candidate snapshot (refactored, no API changes)

* clean up debug statements

* jar from CI build

* XLConnect jar with cleaned up code

* leave out scoped names when cloning

* document effect of new option

* draft NEWS

* readNamedRegion: worksheet scope negative case

* clean up: reword doc, code formatting, comments

* .recycle=FALSE as of previous impl. in getDefinedNames

* simplified formula handling in writeNamedRegionToFile

* add examples for existsName, read/ write named region

* return attributes for getReferenceCoordinatesForName

* worksheet scope attribute values for getDefinedNames

* doc: reflect getDefinedNames in changes, more explicit attribute name

* attributes on getReferenceFormula

* doc review named range / named region

* more user-friendly name for attribute toggle

* jar from rebased xlconnect-java

* remove old xlc jar (rebase leftover)

* final JAR built on xlc-java master
spoltier added a commit that referenced this issue Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants