ReadingSamplesVB

 
Imports GemBox.Spreadsheet

Module Module1

    Sub Main()
        ' TODO: If using GemBox.Spreadsheet Professional, put your serial key below.
        ' Otherwise, if you are using GemBox.Spreadsheet Free, comment out the 
        ' following line (Free version doesn't have SetLicense method). 
        ' SpreadsheetInfo.SetLicense("YOUR-SERIAL-KEY-HERE")

        Dim ef As ExcelFile = New ExcelFile
        Dim sheet As ExcelWorksheet
        Dim row As ExcelRow
        Dim cell As ExcelCell

        ef.LoadXls("..\TestWorkbook.xls")
        ' Uncomment if you want to read from XLSX.
        'ef.LoadXlsx("..\TestWorkbook.xlsx", XlsxOptions.None)

        For Each sheet In ef.Worksheets
            Console.WriteLine("--------- {0} ---------", sheet.Name)

            For Each row In sheet.Rows
                For Each cell In row.AllocatedCells
                    If Not cell.Value Is Nothing Then
                        Console.Write("{0}({1})", cell.Value, cell.Value.GetType().Name)
                    End If

                    Console.Write(vbTab)
                Next

                Console.WriteLine()
            Next
        Next

        Console.ReadLine()
    End Sub

End Module

 

Convert XLS/CSV/HTML/XLSX Files With .NET Component