nnguyen_1
12 years agoContributor
How do I set project variable (DB table type) by scripting?
In regards to the instruction at http://support.smartbear.com/viewarticle/28726, I should be able to set value for project variables by scripting. In VBScript, looks like this:
Project.Variables.AddVariable "MyVar", "String"
Project.Variables.MyVar = "Hello, world!"
My question is how do I set a DB table variable (particularly an instance of Excel file) by scripting? Is it possible to do something like this?
ProjectSuite.Variables.AddVariable "Test", "DB Table"
ProjectSuite.Variables.Test.WorkBook = "C:\test.xlsx"
ProjectSuite.Variables.Test.WorkSheet = "TestDataSheet"
I tried but TestComplete throws run-time error all the time (no syntax error though). Any advice pls?
P/S: I saw some code snippets to add column by column, value by value at http://support.smartbear.com/viewarticle/33254/. However, I think it's too much work, especially my excel file is created on the fly with hundreds of columns and rows, I cannot specify them all one by one.
Project.Variables.AddVariable "MyVar", "String"
Project.Variables.MyVar = "Hello, world!"
My question is how do I set a DB table variable (particularly an instance of Excel file) by scripting? Is it possible to do something like this?
ProjectSuite.Variables.AddVariable "Test", "DB Table"
ProjectSuite.Variables.Test.WorkBook = "C:\test.xlsx"
ProjectSuite.Variables.Test.WorkSheet = "TestDataSheet"
I tried but TestComplete throws run-time error all the time (no syntax error though). Any advice pls?
P/S: I saw some code snippets to add column by column, value by value at http://support.smartbear.com/viewarticle/33254/. However, I think it's too much work, especially my excel file is created on the fly with hundreds of columns and rows, I cannot specify them all one by one.