I asked about this years ago with no helpful responses and still haven't figured it out so thought I would ask again...
The iGrid grid has a LoadIntoArray() method which, as you might expect, will load the grid contents into an Array. With WinBatch it simply crashes WinBatch. No script error.
I have posted my code and then the help file for the Method. Is there something special I need to do in defining the array to make this work?
If igrid.RowCount == 0 Then Break
arr = ArrDimension(igrid.RowCount,igrid.ColCount)
ArrInitialize (arr," ")
Copies cell values into an 1-dimensional or 2-dimensional array.
Sub LoadIntoArray( _
ByVal vStartRow As Variant, _
ByVal vStartCol As Variant, _
ByRef vArray As Variant, _
Optional ByVal bColMajorOrder As Boolean = False _
vStartRow The numeric index or string key of the first row to copy cell values from.
vStartCol The numeric index or string key of the first column to copy cell values from.
vArray The array to copy cell values into.
bColMajorOrder A Boolean value that specifies how to treat the indices of the specified array. For a 2-dimensional array, indicates whether the first index should be treated as row index and the second index should be treated as row index (False) or vice versa (True). For an 1-dimensional array, indicates whether to treat it as a column and copy the vStartCol grid column starting from the vStartRow row into the array (False), or to treat the array as a row and copy the vStartRow grid row starting from the vStartCol column into it (True).
The LoadIntoArray method can be used to quickly copy iGrid cell values into an array. This method allows you to simplify your code and to provide much better performance than copying iGrid cell values in a loop by reading the CellValue property.
The method works with 1- and 2-dimensional arrays of any type. If you provide a 2-dimensional array in the vArray parameter, iGrid will copy the rectangular area of cells with the top-left cell in the row and column defined by the vStartRow and vStartCol parameters. If you pass a 1-dimensional array to the method, the iGrid column vStartCol or the iGrid row vStartRow will be copied depending on the value of the bColMajorOrder parameter.
The method automatically exports the row text column if the specified array has the corresponding column. For instance, if the grid has 5 main columns (its ColCount property equals 5) and you specify a 6-column array when calling LoadIntoArray, the 6th column of the array will be populated with the cell values from the grid's row text column.
Note that this method does not redimension the array to copy the specified cell values. If the specified array does not have enough rows or columns to accommodate all the cell values, the method skips the corresponding cells in the last rows and columns.
iGrid also checks whether the specified array can be used for population. If it is a non-initialized array or it has more than 2 dimensions, iGrid raises its internal "Invalid procedure call or argument" error.
Note that the array is passed as a Variant variable, which allows you to pass an array of any data type for processing. However, you can get the VB "Type mismatch" error during the call of the LoadIntoArray method if the data type of an iGrid cell value isn’t compatible with the base data type of the array.
This method can be used in pair with the LoadFromArray method to copy values from and into array for quick calculations in memory, etc.
1. Copy a whole iGrid control into a 2-dimensional array:
Dim arr(1 To 10, 1 To 5) As Variant
iGrid1.LoadIntoArray 1, 1, arr
2. Export the 3rd column of iGrid into an 1-dimensional array:
Dim arr(1 To 15) As Long
iGrid1.LoadIntoArray 3, 1, arr
3. Export the 2nd row of iGrid into an 1-dimensional array:
Dim arr(1 To 5) As String
iGrid1.LoadIntoArray 2, 1, arr, True