Forum Discussion

sachinmk08's avatar
sachinmk08
New Contributor
7 years ago

Dynamically change column name in Project Variables

Is it possible to create table with dynamic column names. I have below code:

 

Set ti = Project.Variables.VariableByName("MyTable") 
ti.AddColumn("Name")

ti.RowCount = 1

Project.Variables.VariableByName("MyTable").Name(0) = "ABCD"

 

instead of passing "Name", I need to pass variable, like below

colName = "Name"

ti.AddColumn(colName)

Project.Variables.VariableByName("MyTable").colName(0) = "ABCD"

 

Above code returns "undefined" error.