Imports Microsoft.Office.Interop.Excel
Module Module1
Sub Main()
Dim excel As Application = New Application
Dim w As Workbook = excel.Workbooks.Open("C:\Users\Server\Downloads\DONEsb.xls")
For i As Integer = 1 To w.Sheets.Count
Dim sheet As Worksheet = w.Sheets(i)
Dim r As Range = sheet.UsedRange
Dim s1 As String
Dim s As String
Dim array(,) As Object = r.Value(XlRangeValueDataType.xlRangeValueDefault)
If array IsNot Nothing Then
Console.WriteLine("Length: {0}", array.Length)
Dim bound0 As Integer = array.GetUpperBound(0)
Dim bound1 As Integer = array.GetUpperBound(1)
Console.WriteLine("Dimension 0: {0}", bound0)
Console.WriteLine("Dimension 1: {0}", bound1)
For j As Integer = 1 To bound0
s1 = ""
For x As Integer = 1 To bound1
s = array(j, x)
If (s <>"") Then
s1 = s1 & array(j, x)
End If
Console.WriteLine("")
Next
MsgBox(s1)
Console.WriteLine()
Next
End If
Next
w.Close()
End Sub
End Module
Public Class Form6
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Module1.Main()
End Sub
End Class
my output as like
sno accno name bal
1 111 abc 100
2 222 def 200
3 333 ghi 300
4 444 jkl 400
5 555 mno 500
6 666 pqr 600
7 777 stu 700
8 888 vwx 800
9 999 y12 900
10 1111 z34 1000
in my form i take checkboxes like s,t,u,v
when i click on s
sno
1
2
3
4
5
6
7
8
9
10
like prints how...?