Trouble in exporting data from database to excel with multiple tab

  • Hi,

    I am able to create new excel while exporting data to excel using opendatabase but its not working in case of sending data to multiple tab.

    Please provide me working code if any one have.

    Query for exporting data:

    INSERT INTO OPENDATASOURCE

    ('Microsoft.ACE.OLEDB.12.0'

    , 'Data Source=C:\temp\sample.xlsm;Extended Properties=EXCEL 12.0'

    )...[Sheet1$]

    SELECT * FROM #SheetDataComplete

  • I do not use OPENDATASOURCE but the syntax to reference different Worksheets (i.e. "Tabs") is in the FROM clause. So, change [Sheet1$] to [Sheet2$] and see what happens.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply