Forum Discussion
AlexKaras
Champion Level 1
15 years ago> All variables are, essentially, OleVariants in use in the TestComplete environment.
This is not related to TC environment, but all variables in all scripting languages are of OleVariant type because of the requirement to be COM-compatible.
And the actual type of the data that the given variable contains at the given time during runtime is stored within OleVariant structure and can be determined by using VarType() function for VBScript and the similar functions in other scripting languages.
The above is equivalent to declaring the variable in VBA like
Dim obj As Object
In this case these lines will work during runtime:
Set obj = CreateObject("Excel.Application")
Set obj = CreateObject("Word.Application")
but if the variable is declared as
Dim obj As Excel.Application
only the first line will succeed while the second will trigger compilation error.
Excuse me for jumping in, but just my two cents... :)
This is not related to TC environment, but all variables in all scripting languages are of OleVariant type because of the requirement to be COM-compatible.
And the actual type of the data that the given variable contains at the given time during runtime is stored within OleVariant structure and can be determined by using VarType() function for VBScript and the similar functions in other scripting languages.
The above is equivalent to declaring the variable in VBA like
Dim obj As Object
In this case these lines will work during runtime:
Set obj = CreateObject("Excel.Application")
Set obj = CreateObject("Word.Application")
but if the variable is declared as
Dim obj As Excel.Application
only the first line will succeed while the second will trigger compilation error.
Excuse me for jumping in, but just my two cents... :)