I want to export filtered records from a query to an excel template showing common information in the header and calculated sums, etc. in the footer. I want to attach the resulting spreadsheet to a ready-to-send email complete with recipients, subject, and message. And I want to allow the user to do it by clicking a button.
This is easily done by exporting a report to an email in an html attachment, but the data is hard to manipulate once received, and page breaks are prohibiting.
Is it possible to create a DAO.Recordset, and then use OutputTo (acOutputQuery) to export an xls? How then can the xls be attached to an email?
Is there a thread that explains how to create smart templates in Excel? How do you set up rows to capture repeating line items like in Access reporting? Can you aggregate data?
I usually use a method similar to Pootle's code to export the data to a spreadsheet, this approach let's you do pretty much anything with the workbook that you would otherwise be able to do. Check out this site for email info.