export Tables To Excel
Writes each table in the list to an Excel workbook with each table being placed in a new sheet with the sheet name equal to the name of the table. The column names for each table are written as the first row of each sheet.
Uses the longLastingConnection property for the connection.
Parameters
schema Name
the name of the schema containing the tables or null
table Names
the names of the tables to write to a workbook
path
the path to the workbook
db
the database containing the tables