I Could not get "Source Calc Document " - DATA - Format in the " Destination Calc Document " while running the Basic Macro.
Here,
sor_Testing-01.ods (178.6 KB)
mac_Destin_Test-02.ods (34.6 KB)
My Code and attached my Sample Files and Screen shots
Sub test01
Dim Doc1 As Object, Doc2 As Object, oURL1 As String, oURL2 As String
Dim Array1(), Array2(), oRange1 As Object, oRange2 As Object
oURL1 = ConvertToUrl("C:\Users\Accounts-PC\Documents\sor_Testing-01.ods")
oURL2 = ConvertToUrl("C:\Users\Accounts-PC\Documents\mac_Destin_Test-02.ods")
Doc1 = starDeskTop.loadComponentFromURL (oURL1, "_blank", 0,Array1() )
Doc2 = starDeskTop.loadComponentFromURL (oURL2, "_blank", 0,Array2() )
oRange1 = Doc1.Sheets(1).getCellRangeByName("A1:C5")
oRange2 = Doc2.Sheets(0).getCellRangeByName("A3:C7")
oRange2.setDataArray(oRange1.getDataArray())
Doc2.Sheets(0).Columns(2).OptimalWidth = True
End Sub
1
2
3
4
5