My point was to address the worksheet by index rather than by name. You said
you wanted to avoid using the name right ? I mean you do have to direct the
select statment to an entity for it to work with.
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
Use the following to email me
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Debug.WriteLine(ob("ufssz/cvsotAhsfbuTpmvujpotXjui/OFU", False))
End Sub
Private Function ob(ByVal email As String, ByVal inc As Boolean) As
String
Dim ch() As Char
Dim i As Int32
Dim stepValue As Int16
If inc Then stepValue = 1 Else stepValue = -1
ch = email.ToCharArray()
For i = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) + stepValue)
Next
Return New String(ch)
End Function
Time flies when you don't know what you're doing
"Frank" <fr***@frank.com> wrote in message
news:cj**********@news3.zwoll1.ov.home.nl...
if I specify 'worksheet' then I know the name, don't I?
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message news:#t**************@tk2msftngp13.phx.gbl... Im not sure of the exact syntax, but cant you do something like
[Worksheets[0]]
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me
Time flies when you don't know what you're doing
"Frank" <fr***@frank.com> wrote in message
news:cj**********@news1.zwoll1.ov.home.nl... Hi,
I use
Dim cnn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;Data Source=C:\Test.xls;Extended Properties=""Excel 8.0;HDR=YES;""")
Dim da As New OleDb.OleDbDataAdapter("Select * from [Sheet1$]", cnn)
Dim ds As New DataSet("TestExcel")
da.Fill(ds)
to read an excel spreadsheet. Works fine. But is it possible to change
the 'select' statement so I don't have to know the sheetname?
Thanks in advance
Frank