title: How to run a macro only if the Excel workbook is open with VBScript?
body: <p>World!</p>
  
  <p>I am trying to automate a report task at my job and I have the following situation:</p>
  
  <p>I need to execute a macro on a workbook by using a script. I tried to write a vbscript to do the job, and  this is the significant part of it:</p>
  
  <pre><code>Set objWbk = GetObject("***Path***\test.xlsm")
  
  objWbk.Application.Run "test.xlsm!test" 
  
  WScript.Quit
  </code></pre>
  
  <p>The macro runs perfectly. My real problem is that I only want to do the report only if the workbook is open.</p>
  
  <p>Is there a way (in vbs or vba) to determine if that workbook is open ? (by the way, it is located on another computer on my network)</p>