Hi All,
Got a problem here...
I have this TestA.vbs file that calls TestB.vbs file:
And inside the TestB.vbs file I have 2 subs:
When ever I run the TestA.vbs I get an error:
Been looking all around the internet for answers, but failed. Help
Got a problem here...
I have this TestA.vbs file that calls TestB.vbs file:
test 'Calling the test Sub
Sub test
Set oShell = CreateObject("Scripting.FileSystemObject")
Set ReadFile = oShell.OpenTextFile("C:\TestB.vbs")
myScript = ReadFile.ReadAll
Execute(myScript)
ReadFile.Close
...lines of code...
End Sub
Sub test
Set oShell = CreateObject("Scripting.FileSystemObject")
Set ReadFile = oShell.OpenTextFile("C:\TestB.vbs")
myScript = ReadFile.ReadAll
Execute(myScript)
ReadFile.Close
...lines of code...
End Sub
And inside the TestB.vbs file I have 2 subs:
Sub subA
...lines of code...
subB 'calling s Sub named subB
...lines of code...
End Sub
Sub subB
WScript.Echo "hi"
End Sub
...lines of code...
subB 'calling s Sub named subB
...lines of code...
End Sub
Sub subB
WScript.Echo "hi"
End Sub
When ever I run the TestA.vbs I get an error:
Line: 0
Column: 1
Error: Type mismatch: 'subB'
Code: 800A000D
Source: Microsoft VBScript runtime error
System: The data is invalid.
Column: 1
Error: Type mismatch: 'subB'
Code: 800A000D
Source: Microsoft VBScript runtime error
System: The data is invalid.
Been looking all around the internet for answers, but failed. Help
Last edited: