I am using Delphi Rio to control Excel. I am reading and writing whole columns, so I am using VarArrayCreate to create an array of variant to read a column's worth of data. I update specific portions of the data, and then write the update back to the Variant array. When done, I write the whole Variant array back to my column.
While looping through the array, I read a single element of the array.... and potentially write back to that element of the array...
... read from the array
CellText := arrData[i, 1];
... possibly update data
... write the updated data back to the array
arrData[i,1] := CellPadded;
This works without issue. My question has to do with writing the update back to the array. I ran into the function VarArrayPut. Why would I use this as opposed to directly putting the data back into the array like in the code above?