How to Send XLSX Attachments Using Access VBA SendObject
Question details
The user wants to know if Microsoft Access VBA's SendObject command can export and attach database objects in the modern XLSX Excel format.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Automating email attachments from Microsoft Access using macros or VBA code.
- Observed behavior
- The user is unsure if XLSX is a supported output format for the SendObject command, as its availability can vary depending on the specific Access version installed.
Verify that your Microsoft Access installation (such as Access 2019 or Microsoft 365) is fully updated, as older builds may not support the modern XLSX format constant.
Use the acFormatXLSX Constant in VBA
For modern versions of Microsoft Access, you can natively specify the XLSX format directly in your VBA code using the built-in format constant.
In Access 365 and Access 2019, the SendObject command natively supports exporting objects as XLSX attachments. You can apply this either through an Access Macro or directly inside the VBA editor.
Press ALT + F11 in Microsoft Access to open the Visual Basic for Applications (VBA) editor.
Navigate to the module or form code where you want to trigger the email automation.
Type the DoCmd.SendObject method and specify the object you want to send. Set the OutputFormat argument to acFormatXLSX. For example: DoCmd.SendObject acSendQuery, "YourQueryName", acFormatXLSX, "recipient@example.com", , , "Subject Here", "Message Body", True
Save your VBA code and trigger the procedure to confirm that your default email client opens with the XLSX file successfully attached.

Export to XLSX First and Automate via Outlook
If your version of Access does not support acFormatXLSX in SendObject, you can export the file locally first and then attach it using Outlook automation.
View and Edit Your Exported XLSX Files with WPS Office
While Microsoft Access is required to execute specific VBA macros and database queries, you can use WPS Office as a free, lightweight alternative to open, edit, and share the resulting XLSX spreadsheets seamlessly.
- 1. Download WPS Office: Visit the official WPS website to download the free WPS Office suite for your operating system.
- 2. Install the Suite: Run the installer and follow the on-screen prompts to complete the lightweight installation.
- 3. Open Your Spreadsheets: Set WPS Spreadsheet as your default program to instantly open and edit any XLSX files generated by your database.

Frequently Asked Questions
Why is acFormatXLSX not available in my Access Macro dropdown?
Older versions of Microsoft Access, such as Access 2010 or 2013, might not natively support the XLSX format in the EmailDatabaseObject (SendObject) macro action. Upgrading to Access 2019 or Microsoft 365 usually resolves this missing format option.
Can I use DoCmd.SendObject to send a query as an XLSX file?
Yes. By setting the ObjectType argument to acSendQuery, specifying the query name, and setting the OutputFormat argument to acFormatXLSX, you can email the query results directly as an Excel workbook.
What should I do if DoCmd.SendObject fails silently without generating an email?
This typically happens due to issues with the default email client configuration. Ensure that a MAPI-compliant email client like Microsoft Outlook is installed, set as the default mail app in your Windows Settings, and properly configured with an active email profile.




