Forum Discussion
Firstly, what I think you're trying to accomplish is probably better done as a script entirely. I haven't used VB in a long time so i'm not going to try and code this. But nonetheless, from what I can tell your script appears to declare one array in script (CST), then create a object variable in the project ("MyArray") and then tries to save CST into MyArray with line breaks (if my memory of VB serves me correctly).
For a Project Variable to hold an array (2 dimensional only) it would have to be a 'Table' type and not an 'Object' type. In dealing with a 'Table' type variable, you need to define it as follows (this is from the help menu):
Sub TableVarTest
Dim t
' Create a table variable if it doesn't exist
If Not Project.Variables.VariableExists("MyTable") Then
Call Project.Variables.AddVariable("MyTable", "Table")
End If
' Get a reference to the variable
Set t = Project.Variables.VariableByName("MyTable")
' Add columns to the table
Call t.AddColumn("Name")
Call t.AddColumn("Age")
Call t.AddColumn("City")
' Create two rows
t.RowCount = 2
' Fill in the table
' The first row
t.Name(0) = "John Smith"
t.Age(0) = 24
t.City(0) = "Seattle"
' The second row (using the Item property)
t.Item("Name", 1) = "Bob Feather"
t.Item("Age", 1) = 59
t.Item("City", 1) = "Milltown"
End Sub
------
To me it seems that it would be easier to define the array entirely in VB.