LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Bob_Schor

Default for Excel Get Excel Location function

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined. 

The function Excel Get Excel Location function in the NI Report Generation Toolkit takes an Excel cell address (e.g.A1) and returns row/column (array) indices (e.g. 0, 0).  However, if a "non-cell" address, including a blank input, is input, the result is 0, 0, the same as if A1 was entered.  I'd suggest that an index of -1, similar to the "illegal Array index", be returned for cell entries that don't parse as a Cell Address.  Specifically, <blank> would return -1, -1 (which doesn't correspond to the legal cell address A1).  

 

This illogcal behavior of the current function has messed up some functions I've written to manipulate Excel worksheets.  My routines checked for indices "in range", but got fooled by the "wrong" 0, 0 returned by <blank>.  So either I have to build a "validity check" before using this function or (better, in my opinion) the function needs to return legal indices only for legal inputs.

3 Comments
Darren
Proven Zealot

I like the intent of your idea, but I'm concerned that this change will break existing code on upgrade. Specifically, if any code out there assumes that this VI will always return non-negative values, that code will change behavior. We may decide that the risk of such an occurrence is negligible, but I always like to mention the possibility for discussion.

Bob_Schor
Knight of NI

I certainly understand -- this is always a worry when "fixing" things -- is there code that "takes advantage" (or otherwise ignores) bad behavior?  One way around it would be to have a similar function that did it the more-logical way ...

Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.