Start New Discussion within our Software Development Community

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)
This question has already been answered. Start a new discussion instead.