for excel manipulation i use EPPlus.dll. its called
Excel Package
you can download that file
its is quite simple to use
Im Pasting below a sample code that i took from one of my projects. Might be of help to you. it is unedited code
use this import statement
Imports OfficeOpenXml
Sub ExcelOP(filename As String, countryCode As String, data As System.Data.DataTable)
Using excelPackage As New ExcelPackage()
Dim ws As ExcelWorksheet = excelPackage.Workbook.Worksheets.Add(countryCode)
If data.Columns.Count <= 0 Then
Label1.Text = "No Records"
Else
For l As Integer = 1 To data.Columns.Count - 1
ws.Cells(1, l).Value = HttpUtility.HtmlDecode(data.Columns(l).ToString)
Next
Using rng As ExcelRange = ws.Cells(1, 1, 1, data.Columns.Count - 1)
rng.Style.Font.Bold = True
rng.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid
rng.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(192, 192, 192))
End Using
Dim totalRecords As Integer = data.Rows.Count
For r As Integer = 0 To totalRecords - 1
For s As Integer = 1 To data.Columns.Count - 1
ws.Cells(r + 2, s).Value = HttpUtility.HtmlDecode(data.Rows(r)(s).ToString)
Next
Next
excelPackage.SaveAs(New FileInfo(filename))
excelPackage.Dispose()
End If
End Using
End Sub