Calling external unit.routine using variable1.variable2
Hello everyone.
I have a little problem with the following:
Usage:
I have an Excel spreadsheet that containing functions and sub-functions
Example:
A | B | C | |
1 | Run? | Tarteted Main Functions to Test | Targeted Sub Function to Test |
2 | y | B01_Operation | CreateOperation |
I have this code:
Dim Excel, RowCount, ColumnCount, i, j, s, isRun, functionName, subFunctionName
Set Excel = Sys.OleObject("Excel.Application")
Excel.Workbooks.Open("C:\TestComplete 15 Projects\Data_Files\A01_Test_Setup.xlsx")
RowCount = Excel.ActiveSheet.UsedRange.Rows.Count
ColumnCount = Excel.ActiveSheet.UsedRange.Columns.Count
For i = 2 To RowCount 'Start at 2nd row since I use the first row as headers
For j = 1 To ColumnCount
if j = 1 then
isRun = VarToString(Excel.Cells(i,j))
if isRun = "y" then
functionName = VarToString(Excel.Cells(i,j+1)) 'Assign Excel cell B2 value to functionName
subFunctionName = VarToString(Excel.Cells(i,j+2)) 'Assign Excel cell C2 value to subfunctionName
'At this point, I would like to use the Call statement using the variables functionName and subfunctionName as follows:
Call functionName.subFunctionName
'of course, I know the Call statement will not work as is but I am asking if there is another way to accomplish this.
End if
End If
Next
Next
Excel.Quit
Thanks in advance for your help.