title: QTP VBScript type mismatch error in function without arguments
body: <p>I have run into an annoying problem in QTP (Quick test pro) using VBScript.</p>
  
  <p>I have defined this sub in VBScript (I have also tried defining it as a function with the same result):</p>
  
  <pre><code>Sub KillProcess()
    KillprocessIE = "The process i want to kill"
    Set ProcessList2 = GetObject("winmgmts://.").InstancesOf("win32_process")
    For Each Process In ProcessList2
      If Process.Name = KillProcessIE Then
        Process.Terminate
        Exit for
      End If
    Next
  End Sub
  </code></pre>
  
  <p>But when I try to run it either by using </p>
  
  <pre><code>call KillProcess()
  KillProcess()
  KillProcess
  </code></pre>
  
  <p>I get an error saying "Typer stemmer ikke overens: 'KillProcess'" with translated from Danish means something like "Types does not match: 'KillProcess'. I am guessing it is a type mismatch error but due to translation I cant be sure.</p>
  
  <p>What types is it talking about? I have no arguments in my function call and I am not assigning any values to anything?</p>
  
  <p>It should also be said that if I run the exact same code directly without defining it as a function, it works without issue.</p>