title: Executing VBScript file from Excel VBA macros
body: <p>I need some excel vba examples, where with in the VBA code(Excel Macro) i could call a VBScript and will get some values like filename and directory information from the vbscript and assign it to the variables in VBA code.
  Thank you in advance</p>
  
  <p>Some thing like this</p>
  
  <p>VBA macro:</p>
  
  <pre><code>Sub Foo2Script
  Dim x As Long
  x=2
  'Call VBscript here
  MsgBox scriptresult
  End Sub
  </code></pre>
  
  <p>VBScript:</p>
  
  <pre><code>Dim x, y ,Z
  x = x_from_macro
  y = x + 2
  Z = X+Y
  scriptresult = y,Z
  </code></pre>