I may have found a very nice solution to my problem, thanks to a post by FJCC that I found elsewhere. I never knew that you could do anything directly with a sheet's dataArray, other than getDataArray() and setDataArray(). Whether it can be used to move data from one SS to another, I still have to determine. Regardless, this appears to be the best way to move large amounts of data between sheets.
Code: Select all
Dim Doc as Object
Dim Sheets as Object
Dim fSheet as Object ' from sheet
Dim fRange as Object
Dim tSheet as Object ' to sheet
Dim tRange as Object
Doc = ThisComponent
Sheets = Doc.Sheets()
fSheet = Sheets.getByName("ALPHA")
tSheet = Sheets.getByName("BETA")
fRange = fSheet.getCellRangeByName("A6:G350")
tRange = tSheet.getCellRangeByName("A6:G350")
tRange.DataArray = fRange.DataArray
This approach is fast and avoids the problem of having to make a copy of the data with getDataArray and then store it elsewhere with setDataArray. It also solves the problem I originally complained about in that it doesn't select the dataArrays as transferable content does.