Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Excel Sheet Names w/o Excel Object

Status
Not open for further replies.

bjd4jc

Programmer
Nov 8, 2001
1,627
US
I am trying to get the names of all the sheets in an excel spreadsheet without using the Excel object Model.

In VB6 I would use ADOX to do this. What direction should I take to do this without the use of the excel object model in .NET?
 
I figured it out. I finally found it in the vb Help.

Here is the code to return them into a datatable

Code:
Public Function GetTables(ByVal conn As OleDb.OleDbConnection) As DataTable
    Dim schemaTable As DataTable = conn.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, _
        New Object() {Nothing, Nothing, Nothing, "TABLE"})
        
    Return schemaTable
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top