Export HTML Files into Excel using Windows Forms

I am also tied to search in google. Finally am never get any article .am getting all article in ASP.NET exporting from gridview .
coming to the point now am giving the code to export html files data to excel file .from a folder .my requirement
so the bellow code works for me.

Add the:
Microsoft.Office.Interop.Excel.dll u can download from internet .
 
After click event my code works here: 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.ComponentModel;  
  4. using System.Data;  
  5. using System.Drawing;  
  6. using System.Linq;  
  7. using System.Text;  
  8. using System.Windows.Forms;  
  9. using System;  
  10. using System.IO;  
  11. using Excel = Microsoft.Office.Interop.Excel;  
  12. namespace ExportData  
  13. {  
  14.     public partial class Form1: Form  
  15.     {  
  16.         public Form1()  
  17.         {  
  18.             InitializeComponent();  
  19.         }  
  20.         private void button1_Click(object sender, EventArgs e)  
  21.         {  
  22.             string path = textBox1.Text + "/";  
  23.             var d = new DirectoryInfo(path); //Assuming Test is your Folder  
  24.             if (textBox1.Text.Length > 0)  
  25.             {  
  26.                 var files = d.GetFiles("*.html"); //Getting Text files  
  27.                 foreach(var file in files)  
  28.                 {  
  29.                     var app = new Excel.Application();  
  30.                     try  
  31.                     {  
  32.                         var fullPathnew = d + file.Name;  
  33.                         var wb = app.Workbooks.Open(fullPathnew);  
  34.                         wb.SaveAs(d + file.Name.Replace(".html"".xls"), Excel.XlFileFormat.xlExcel7);  
  35.                         wb.Close();  
  36.                     }  
  37.                     catch (Exception ex)  
  38.                     {  
  39.                         MessageBox.Show(ex.Message);  
  40.                     }  
  41.                     finally  
  42.                     {  
  43.                         app.Quit();  
  44.                     }  
  45.                 }  
  46.             }  
  47.         }  
  48.     }  
  49. }  
You can download the same solution bellow link.