Answered by:
GetOleDbSchemaTable - Extract Excel Column names

Question
-
I am being slowly driven crazy trying to get a list of Excel column names using GetOleDbSchemaTables. What I am trying to do is develop a simple VB.NET Application where the user will select an Excel Spreadsheet, and I will 'query' its schema and fill a listbox with Column names in the Spreadsheet.
I thought this would be a fairly easy task and I downloaded two KB articles, KB257819 and Q318373 - astonishingly, the code presented in BOTH of these articles simply does not work. In one of them its bugged because two values used are not defined at all, and in the other, the code runs but returns 0 for tables (thats, zero for # of tables, where in fact there is 1 in the Spreadsheet).
Does anyone have any simple code (ADO or OLEdb) for doing this (what should be) simple task?
Again, all I want to do is query the metadata and get a dataset (or arraylist, whatever) of the column names.
Any help would be GREATLY appreciated!!!
- Beebo- Moved by Cindy Meister MVP Wednesday, November 5, 2008 6:47 PM not about the VSTO technology (Moved from Visual Studio Tools for Office to Off-Topic Posts (Do Not Post Here))
Wednesday, November 5, 2008 6:23 PM
Answers
-
Hello Beebo,
Thank you for your post! Unfortunately there is not a current forum to post the question you are asking so I would recommend that you post your question to one of the microsoft.public.dotnet.framework.adonet newsgroups located here:
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.dotnet.framework.adonet&mid=3d7e0745-a5b8-4b4a-88fb-480cfd90411bHope that helps!
Vijay Mullick Tier 2 Application Support Server and Tools Online Engineering Live Services Team- Proposed as answer by Vijay Mullick Thursday, November 6, 2008 6:14 AM
- Marked as answer by Vijay Mullick Friday, December 5, 2008 5:30 AM
Thursday, November 6, 2008 6:14 AM
All replies
-
I'm afraid your question is off-topic in the VSTO forum. The Please Read First message at the top of the forum briefly explains what VSTO is and what the forum supports. It also contains a list of links for venues for non-VSTO, Office-related questions.
You might try the excel.programming newsgroup, or the data.ado newsgroup (which you'd reach over the "all newsgroups" link).
Cindy Meister, VSTO/Word MVPWednesday, November 5, 2008 6:47 PM -
Hello Beebo,
Thank you for your post! Unfortunately there is not a current forum to post the question you are asking so I would recommend that you post your question to one of the microsoft.public.dotnet.framework.adonet newsgroups located here:
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.dotnet.framework.adonet&mid=3d7e0745-a5b8-4b4a-88fb-480cfd90411bHope that helps!
Vijay Mullick Tier 2 Application Support Server and Tools Online Engineering Live Services Team- Proposed as answer by Vijay Mullick Thursday, November 6, 2008 6:14 AM
- Marked as answer by Vijay Mullick Friday, December 5, 2008 5:30 AM
Thursday, November 6, 2008 6:14 AM