How to Export Data to Excel in VB.NET with type object

Public Class Form1 Private Sub ExportExcel() Dim xlApp As Object If xlApp Is Nothing Then MessageBox.Show(“Excel is not properly installed!!”) Return End If Dim i As Integer Dim xlWorkBook As Object Dim xlhdWorkSheet As Object xlWorkBook = xlApp.Workbooks.Add…
Read more »How to Export Data to Excel in VB.NET

Set target framework: .Net framework 4 Add references: Microsoft.Office.Interop.Excel Example code: Imports Excel = Microsoft.Office.Interop.Excel Public Class Form1 Private Sub ExportExcel() Dim xlApp As Excel.Application = New Microsoft.Office.Interop.Excel.Application() If xlApp Is Nothing Then MessageBox.Show(“Excel is not properly installed!!”)…
Read more »