title: Calling a Vba script in a HTML5 page
body: <p>I create a script in Vba allowing to compare reports in Word and I would like to create a page in HTML allowing to launch the Vba script after clicking a button.</p>
  
  <p>When I try to do that, I obtain the message "<em>ReferenceError: myFunction is not defined</em>" in Firefox and Chrome. If I try the same on IE, I obtain the error "'myFunction' is undefined".</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Reports Comparison&lt;/title&gt;
      &lt;script type="text/vbscript" src="myScript.vbs"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;input type="button" value="Test" onClick="myFunction()"&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>myFunction is correctly defined in the file myScript.vbs :</p>
  
  <pre><code>Sub myFunction ()
      Dim strFolderA As String
      Dim strFolderB As String
      Dim strFolderC As String
      Dim strFileSpec As String
      Dim strFileName As String
      Dim objDocA As Word.Document
      Dim objDocB As Word.Document
      Dim objDocC As Word.Document
      strFolderA = InputBox("Enter path to base documents:")
      strFolderB = InputBox("Enter path to new documents:")
      strFolderC = InputBox("Enter path for document comparisons to be saved:")
      strFileSpec = "*.docx"
      strFileName = Dir(strFolderA &amp; strFileSpec)
      Do While strFileName &lt;&gt; vbNullString
          Set objDocA = Documents.Open(strFolderA &amp; strFileName)
          Set objDocB = Documents.Open(strFolderB &amp; strFileName)
          Application.CompareDocuments _
              OriginalDocument:=objDocA, _
              RevisedDocument:=objDocB, _
              Destination:=wdCompareDestinationNew
          objDocA.Close
          objDocB.Close
          Set objDocC = ActiveDocument
          objDocC.SaveAs FileName:=strFolderC &amp; strFileName
          objDocC.Close SaveChanges:=False
          strFileName = Dir
      Loop
      Set objDocA = Nothing
      Set objDocB = Nothing
  End Sub
  </code></pre>
  
  <p>Could you please help me to do that?</p>
  
  <p>Regards</p>