Free for PREMIUM members
Set rs = db.OpenRecordset("Query1")
Set xlObj = CreateObject("Excel.Application")
Set Sheet = xlObj.activeworkbook.Sheets(1)
'copy the headers
Dim iRow, iCol
iRow = 1
For iCol = 0 To rs.Fields.Count - 1
Sheet.cells(iRow, iCol + 1).Value = rs.Fields(iCol).Name
Sheet.Range("A2").CopyFromRecordset rs 'this copy just the data
Open in new window
Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!
Learn how Concerto can help you.
DoCmd.TransferSpreadsheet acExport, , "qryDelRepCAN", "File_Path", True, "Canada_Past_Due"
We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!