Hi everyone

i have a connection to my sheet like this

Dim da As New OleDbDataAdapter("Select * from [EBU 2 LOB$]", con)

but i want to use this

Dim Sheet1_EBU as string = "EBU 2 LOB$"

so that the code will be something like this i think?

Dim da As New OleDbDataAdapter("Select * from [ & Sheet1_EBU &]", con)

but i have a error it said could not find the the object [ & Sheet1_EBU &]

How can i write it in a appropriate way?

so that the code will be something like this i think?

Close. You forgot to close the two strings:

Dim da As New OleDbDataAdapter("Select * from [" & Sheet1_EBU & "]", con)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.