i have a 29×29 dimensional matrix which I want to include in an excel sheet.
For example a matrix build up within in a formula like this:
Dim Output = ? # 29 # 29 // Dim a 29x29 matrix
Output[0,28][0,28] = -1 // Fill all cells with -1
I want this Output to be copied into an excel sheet. I used following code:
Const sExcelSheet As String = "P:\TestFile.xlsx"
'access data from FlexPro
Dim oFolder As Folder
Set oFolder = ActiveDatabase.RootFolder
Set matrix = oFolder.Object("Formel", fpObjectTypeFormula).Value
' open Excel sheet
Dim oExcel As Object
Set oExcel = CreateObject("Excel.Application")
.Visible = True
.Workbooks.Open Filename:=sExcelSheet, ReadOnly:=False
Dim oSheet As Object
Set oSheet = .Worksheets(1)
oSheet.Range("C3:AE31") = matrix
Set oExcel = Nothing
The matrix is supposed to be placed starting at cell C3 or placed in the area from C3 to AE31. I keep getting runtime errors though.
Can someone tell me what i did wrong. Thanks in advance.