tyr This code in vb.net
<pre lang="vb">Private Sub GetExcelSheetNames(ByVal fileName As String)
Dim strconn As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" &
fileName & ";Extended Properties=""Excel 12.0 Xml;HDR=YES"";"
Dim conn As New OleDbConnection(strconn)
conn.Open()
Dim dtSheets As DataTable =
conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim listSheet As New List(Of String)
Dim drSheet As DataRow
For Each drSheet In dtSheets.Rows
listSheet.Add(drSheet("TABLE_NAME").ToString())
Next
For Each sheet As String In listSheet
TextBox1.Text = TextBox1.Text & sheet & vbNewLine
Next
conn.Close()
End Sub