Origin Ver. and Service Release: 9.1.0 Sr1 Operating System: Windows7 32 bit
I don't understand the behavior of the %() substitution:
With Book2 and Sheet1 active: >>range rDa1 = %([Book2]Sheet1,1); type %(rDa1) [Book2]Sheet1!Book2_A // OK
With Sheet3 active: >>range rDa1 = %([Book2]Sheet1,1); type %(rDa1) [Book2]Sheet3!Book2_A // ???
Shouldn't the result be independent of which Book/Sheet is active?
Similarly: With Sheet3 active: >>range rDa1 = %([Book2]Sheet3,1); type %(rDa1) [Book2]Sheet3!Book2_A@2 // OK (I only have two sheets: Sheet1 and Sheet3)
With Sheet1 active: >>range rDa1 = %([Book2]Sheet3,1); type %(rDa1) [Book2]Sheet1!Book2_A@2 // Not good
What is also surprising is that the dataset name is correct in every case: I obtain Book2_A or Book2_A@2 as it should be; however the SheetName (Sheet1 or Sheet3) is inconsistent and depends on which worksheet is active.
The %() substitution returns only the name of the dataset so in the second example, %([Book2]Sheet1,1) only returns Book2_A. But in absence of a proper absolute range expression, the range declaration (range rDa1 = ...) appends the range of the active sheet (i.e. [Book2]Sheet3) in front of the right hand-side expression!