1.11M Members

Connection using Excel

 
0
 

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?

 
0
 

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)
Question Answered as of 1 Year Ago by deceptikon
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: