emmanuelkhumbudzo / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

Enhancement: Default worksheet #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Paul,

I have to work with workbooks where the first sheet contains the data but 
the name of the sheet varies with every file. Thought that wold be cool to 
repleace the default name ("Sheet1") by using the GetOleDbSchema from the 
connection to get the name of the first worksheet. I think this will make 
the whole thing really flexible.

Cheers

Claudio

Original issue reported on code.google.com by lildi...@gmail.com on 25 Feb 2010 at 12:30

GoogleCodeExporter commented 9 years ago
I added this enhancement in the latest release (version 1.1.58), so now you can 
reference a worksheet by its index number. 

One important thing to note, however, is that the worksheet index numbers are 
ordered 
alphabetically by the worksheet names. It is not ordered by its position within 
the 
workbook. For example, if the first worksheet is named "Financials" and the 
second 
worksheet is named "Data", then the "Data" worksheet will be the first index 
number 
and "Financials" will be the second index number. This is a result of the 
limitation 
of the GetOleDbSchema command which returns the worksheet names alphabetically 
and 
not by their position within the workbook.

Original comment by paulyo...@gmail.com on 4 Mar 2010 at 3:13

GoogleCodeExporter commented 9 years ago
Hi Paul,
I would like to start using reference a worksheets by indexes,however I 
couldn't find how to use GetOleDbSchema. May I ask you to give me a small 
example how to use them?
Kind regards Robert

Original comment by robertbi...@gmail.com on 11 Jun 2010 at 12:43

GoogleCodeExporter commented 9 years ago
Here's the documentation about using Worksheet indexes: 
http://code.google.com/p/linqtoexcel/wiki/UsingLinqToExcel#Query_a_specific_work
sheet_by_index

Let me know if you have any more questions.

Original comment by paulyo...@gmail.com on 11 Jun 2010 at 1:04