Mengolah Excel data dengan Visual Basic

Mengolah data excel melalui visual basic tidaklah terlalu sulit. Berikut ini di sajikan salah satu contohnya.


Imports Excel = Microsoft.Office.Interop.Excel


Public Sub New()

' This call is required by the Windows Form Designer.


InitializeComponent()

System.Threading.Thread.CurrentThread.CurrentCulture = _
System.Globalization.CultureInfo.CreateSpecificCulture("en-US")



Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oRng As Excel.Range

Dim misValue As Object = System.Reflection.Missing.Value

oXL = New Excel.ApplicationClass
oWB = oXL.Workbooks.Add(misValue)
oSheet = oWB.Sheets(2) ' or ("sheet1")
oSheet.Range("A1:A2").Value = "http://vb.net-informations.com"

oXL.Visible = True




End Sub