title: Unable to run macro from java code
body: <p>Below is my vb script that i want to run from my javacode. I am calling it using the below command 
          filePath = "D:\myVBS.vbs";</p>
  
  <pre><code>    Runtime.getRuntime().exec(filePath);
  </code></pre>
  
  <p>i see the below error : java.io.IOException: Cannot run program "D:\myVBS.vbs": CreateProcess error=193, %1 is not a valid Win32 application</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Set objExcel = CreateObject("Excel.Application")
  Set objWorkbook = objExcel.Workbooks.Open("D:\easyAutomation2017\GoEasy\requiredSource\TestData1.xlsm")
  
  objExcel.Application.Run "TestData1.xlsm!refreshXLS"
  objExcel.ActiveWorkbook.Close
  
  objExcel.Application.Quit
  WScript.Quit</code></pre>
  </div>
  </div>
  </p>
  
  <p>After googling i understood that this is the problem: You cannot run a shell script on Windows directly as it is no executable in the Windows sense</p>
  
  <p>So how do i run it.</p>
  
  <p>Please help!!
  Thanks</p>