Here's an OPENROWSET Excel insert which has been working for a while:
-- INSERT the results into the newly-created spreadsheet
INSERT INTO OPENROWSET ('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;DATABASE=\\ReportingServer\D$\EDIInvoices.xls',
'Select * from EDIInvoices')
SELECT * from #EDIInvoicesPivot
Remember, this statement is running on the SQL server, not on your desktop, so the location of the Excel file is relative to the server. In the example above, the Excel file is on another (reporting) server.
Cheers
ChrisM
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden