title: How to store HTML user input data into excel using javascript
body: <p>I need to create HTML page with JavaScript which can store user information into excel directly. Information can contain user input fields like:</p>
  
  <ol>
  <li>First Name (Datatype: Text) </li>
  <li>Last Name (Data Type: Text)</li>
  </ol>
  
  <p>I have tried below code for storing values into CSV but I don't know how to store value in excel sheet.</p>
  
  <pre><code>&lt;hrml&gt;
    &lt;head&gt;
       &lt;script language="javascript"&gt;
          function WriteToFile(passForm) {
          var fso = new ActiveXObject("Scripting.FileSystemObject");
          var fileLoc = "D:\\sample.csv";
          var file  = fso.OpenTextFile(fileLoc, 8, true,0);
          file.writeline(passForm.FirstName.value + ',' +
                   passForm.LastName.value);
          file.Close();
          alert('File created successfully at location: ' + fileLoc);
        }
  
      &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
   &lt;p&gt;create a csv file with following details -&lt;/p&gt;
   &lt;form&gt;
      Type your first name: &lt;input type="text" name="FirstName" size="20"&gt;
      Type your last name: &lt;input type="text" name="LastName" size="20"&gt;
      &lt;input type="button" value="submit" onclick="WriteToFile(this.form)"&gt;
   &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Kindly help me for this "How to write HTML input data into Excel using JavaScript"</p>
  
  <p>Thank you so much in advance.</p>