Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27072

excel file read query

$
0
0
hi
i have started a topic on this before but can seem to find the post in my profile.
anyway
i have code that read my excel file here is the code
Code:

    Private Sub btnRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRead.Click
        If Not String.IsNullOrEmpty(txtFileName.Text) Then
            Try
                btnClose.Enabled = False
                Dim OExcelHandler As New ExcelHandler()
                Dim ds As DataSet = OExcelHandler.GetDataFromExcel(txtFileName.Text.Trim())

                If ds IsNot Nothing Then
                    dgvExcelData.SelectionMode = DataGridViewSelectionMode.FullRowSelect
                    dgvExcelData.EditMode = DataGridViewEditMode.EditProgrammatically
                    dgvExcelData.DataSource = ds.Tables(0)
                End If
             
            Catch ex As Exception

            Finally
                btnClose.Enabled = True
            End Try
        End If
    End Sub

how do i get that code to read a certain worksheet in my workbook. at the moment the code steps through each tab which is fine but i need to get it to look at certain tabs when i click on my radio button and find certain words in the worksheet

anyone and ideas

Viewing all articles
Browse latest Browse all 27072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>