Quote:
I have tried the code below but it exporting all columns.
Probably because this
sql = "SELECT * FROM publicationinfo"
request all the columns from database.
Either you have to say which columns you want in the SQL query, either you have to filter them when you write to excel.
SQL SELECT Statement[
^]