Here's code that I use to export a query to Excel and automatically print a copy (thank you Jimmy the Geek for the kernel ideas!). By setting the print/export to begin at a specific row you can keep the column headers intact (row headings would be protected by adjusting the beginning row). Each time the routine is run the file is saved with a date value appended to the name--hope this helps:<br><br>Private Const XLS_LOCATION As String = "C:\folder\'nother\file.xls"<br><br><br>Public Sub ExportToExcel()<br>'Exports the qry_Visits to an Excel template<br>'and prints it<br><br>On Error GoTo ExportToExcel_Err<br> 'DAO object variables<br> Dim Db As Database<br> Dim rs As Recordset<br> Dim qdfMonitorVisits<br> <br> 'Excel object variables<br> Dim objXL As Object, objSheet As Object<br> Dim strSaveAs As String<br> Dim RowNum As Integer<br> <br> DoCmd.Hourglass True<br> <br> Set Db = CurrentDb()<br> Set qdfVisits = Db.QueryDefs("qry_VisitsbySite"

<br> <br> 'Open, Visits.xls (based on Template) and make it visible<br> Set objXL = GetObject(XLS_LOCATION)<br> objXL.Application.Visible = True<br> objXL.Parent.Windows(1).Visible = True<br> 'Open the qry_Visits recordset<br> Set rs = qdfVisits.OpenRecordset(dbOpenSnapshot)<br> Set objSheet = objXL.Worksheets("Visits"

<br> <br> objSheet.Activate<br> <br> RowNum = 2<br> <br> 'Insert the data from the qry_Visits recordset into the Visits worksheet<br> With rs<br> .MoveFirst<br> Do Until .EOF<br> objXL.ActiveSheet.Cells(RowNum, 1).Value = rs![Site]<br> objXL.ActiveSheet.Cells(RowNum, 2).Value = rs![VisitDate]<br> objXL.ActiveSheet.Cells(RowNum, 3).Value = rs![Type]<br> objXL.ActiveSheet.Cells(RowNum, 4).Value = rs![Emp]<br> objXL.ActiveSheet.Cells(RowNum, 5).Value = rs![DaysOnSite]<br> objXL.ActiveSheet.Cells(RowNum, 6).Value = rs!RowNum = RowNum + 1<br> .MoveNext<br>Loop<br> .Close<br> End With<br><br> 'objSheet.PrintOut<br><br> ' Set the save string, and save the spreadsheet<br> strSaveAs = "C:\my documents\folder\filename.xls"<br> strSaveAs = strSaveAs & "SiteVsts_" & Format(Date, "medium date"

<br> <br> objXL.SaveAs strSaveAs<br> 'Quit Excel<br> objXL.Application.DisplayAlerts = False<br> objXL.Parent.Quit<br> <br> <br> 'Empty Object Variables<br> Set objXL = Nothing<br> Set objSheet = Nothing<br> <br> Set rs = Nothing<br> Set qdfMonitorVisits = Nothing<br> <br> MsgBox "Export to Excel successful. Report should be ready at printer!"<br>