Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Select Data in Worksheet 1

I am able to select data from worksheet 1 if I know the sheet name...

OleDbCommand objCmdSelect =new OleDbCommand("SELECT * FROM [Sheet1$]",
objConn);

How would I just get the data from the first (primary sheet) if I do not
know the name of Sheet1$ ?

Thanks in advance!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Select Data in Worksheet 1

Jim,

This self-same question was asked back in April. Here is my suggested
solution using ADOX to get that first sheet name
http://tinyurl.com/yw6dp

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jim M" wrote in message
...
I am able to select data from worksheet 1 if I know the sheet name...

OleDbCommand objCmdSelect =new OleDbCommand("SELECT * FROM [Sheet1$]",
objConn);

How would I just get the data from the first (primary sheet) if I do not
know the name of Sheet1$ ?

Thanks in advance!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select/Sort Hierarichal Data in worksheet S. Sakthivel Excel Worksheet Functions 3 December 18th 08 12:04 PM
Reference another Worksheet and Conditionally Select Data Tina Hane Excel Worksheet Functions 3 March 12th 08 10:57 PM
Select data onto new worksheet RBW Excel Discussion (Misc queries) 0 August 2nd 07 06:16 PM
SELECT large amount of data in a worksheet OTS Excel Discussion (Misc queries) 3 August 13th 05 04:43 PM
Move select data to another worksheet Annabelle Excel Discussion (Misc queries) 3 July 27th 05 06:01 PM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"