ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help: extracting Execel tables with ADO without reordering them (https://www.excelbanter.com/excel-programming/305066-help-extracting-execel-tables-ado-without-reordering-them.html)

Lucia[_2_]

help: extracting Execel tables with ADO without reordering them
 
I'm trying to find a way to extract all the worksheets
(tables) from an Excel workbook and having them returned
in the same order in which they're originally defined in
the workbook (not alphabetically).

The VB.net instruction used is:

tables = ccn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
New Object() {Nothing, Nothing, Nothing, "TABLE"})


Is there any other way (like query, etc.) to get all the
tables?

Thanks,
Lucia

Jamie Collins

help: extracting Execel tables with ADO without reordering them
 
"Lucia" wrote ...

I'm trying to find a way to extract all the worksheets
(tables) from an Excel workbook and having them returned
in the same order in which they're originally defined in
the workbook (not alphabetically).


None I know of. ADO classic's OpenSchema method can be used to return
a recordset of schema info for Excel 'tables' but again in
alphabetical order of name. An Excel table can be a worksheet or a
worksheet- or workbook-level defined Name; you must parse the name to
remove define Names e.g.

http://groups.google.com/groups?thre...ing.google.com

Note the TABLE_GUID for an Excel data source is always null, however
the DATE_CREATED field may be of some use to you.

BTW I'm guessing ADO lacks this functionality because tables in a
'normal' DBMS aren't considered to have ordinal positions.

Jamie.

--


All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com