Message 1 of 5
GoExcel.NameRange ERROR: Public member 'GetLength' on type 'String' not found.

Not applicable
11-12-2017
09:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to update a MultiValue List using GoExcel.NameRangeValue in iLogic.
So far all worked well, when the name range had more than one row But getting an error: "Public member 'GetLength' on type 'String' not found." when that Range has less than two rows.
I'm a not a VBA coder by any stretch of the imagination but have dabbled in coding in other languages. I've used a code snippet from Xiaodong Liang that gets the job done when ranges are => 2 rows
Any help would be appreciated.
Here is my code:
SyntaxEditor Code Snippet
GoExcel.Open("CabSpecBook.xlsx", "Wall Cabinets") 'Code Snipet to read Name Range in Excel 'this Is an array X*Y dimension rangeArray = GoExcel.NamedRangeValue("_15inHW1D") 'create a list to get the values of the columns Dim oList As ArrayList oList = New ArrayList 'rangeArray.GetLength(0) means how many rows 'rangeArray.GetLength(1) means how many colmuns Dim oRowsCount oRowsCount = rangeArray.GetLength(0) Dim oColCount oColCount = rangeArray.GetLength(1) Dim oRowIndex As Integer Dim oColIndex As Integer For oRowIndex = 1 To oRowsCount ' add value of each row one by one For oColIndex = 1 To oColCount oList.Add(rangeArray(oRowIndex,oColIndex)) Next Next 'Set it To the list Parameter MultiValue.List("CabModNum") = oList iLogicVb.UpdateWhenDone = True