title: How to save your html form to excel sheet using java script?
body: <p>I have one html form, I want to store that form data into excel sheet. I am using linux(Fedora 15) OS. I have one VB Script that works for me fine in Internet Explorer, Windows OS. But Same script not working in linux mozilla firefox browser. Please tell me java script for store my html data into excel sheet, that works in linux OS and mozilla firefox browser. I share my VB script please tell me correction in that so i can use it as java script.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script language="vbscript" type="text/vbscript"&gt;
  Sub Sample()
  Dim iRow
  Set objExcel = CreateObject("Excel.Application")
  Set objWorkbook = objExcel.Workbooks.Open("home/Book1.xlsx")
  'Document.GetElementsByName("fname")(0).Value="C#"
  'Document.GetElementsByName("lname")(0).Value="Corner"
  'Document.GetElementsByName("Add1")(0).Value="Tamilnadu"
  'Document.GetElementsByName("Add2")(0).Value="Coimbatore"
  objExcel.Application.Visible = True
  objWorkbook.Windows(1).Visible = True
  set XlSheet =objWorkbook.Sheets(1)
  XlSheet.Activate
  iRow = 1
  With objExcel
  Do While .Cells(iRow, 1).value &lt;&gt; ""
  .Cells(iRow, 1).activate
  iRow = iRow + 1
  Loop
  .Cells(iRow, 1).value=Document.GetElementsByName("fname")(0).Value
  .Cells(iRow, 2).value=Document.GetElementsByName("lname")(0).Value
  .Cells(iRow, 3).value=Document.GetElementsByName("Add1")(0).Value
  .Cells(iRow, 4).value=Document.GetElementsByName("Add2")(0).Value
  MsgBox "Data Added Sucessfully",vbinformation
  Document.GetElementsByName("fname")(0).Value=""
  Document.GetElementsByName("lname")(0).Value=""
  Document.GetElementsByName("Add1")(0).Value=""
  Document.GetElementsByName("Add2")(0).Value=""
  End With
  objWorkbook.save
  objWorkbook.close
  Set objWorkbook = Nothing
  Set objExcel = Nothing
  End Sub
  &lt;/script&gt;
  
  &lt;body&gt;
  &lt;form&gt;
  &lt;fieldset&gt;
  
  &lt;center&gt;
  
  First name:&lt;br&gt; 
  &lt;input type="text" name="fname" Value=""&gt;&lt;br&gt;
  Last name:&lt;br&gt;
  &lt;input type="text" name="lname" Value=""&gt;&lt;br&gt;
  Address1:&lt;br&gt;
  &lt;input type="text" name="Add1" Value=""&gt;&lt;br&gt;
  Address2 :&lt;br&gt;
  &lt;input type="text" name="Add2" Value=""&gt;&lt;br&gt;
  &lt;br&gt;
  &lt;input type="button" onclick="Sample()" value="Submit" /&gt;&lt;br&gt;
  &lt;/center&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>For this code i have created excel sheet in my computer every time i click on Submit button one row is created and store data in my excel sheet.</p>