logo
search
File Format & Compatibility

How to Send XLSX Attachments Using Access VBA SendObject

Phi Hung VoPhi Hung Vo Oct 19, 2026 868 views

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.

Can Access VBA SendObject Export Files as XLSX Attachments?
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press ALT + F11 in Microsoft Access to open the Visual Basic for Applications (VBA) editor.

2
Locate Your Email Procedure

Navigate to the module or form code where you want to trigger the email automation.

3
Implement the SendObject Command

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

4
Run and Test

Save your VBA code and trigger the procedure to confirm that your default email client opens with the XLSX file successfully attached.

Use the acFormatXLSX Constant in VBA
Macro Alternative: If you are using Access Macros instead of VBA, you can select 'Excel Workbook (*.xlsx)' directly from the Output Format dropdown inside the EmailDatabaseObject macro action.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website to download the free WPS Office suite for your operating system.
  2. 2. Install the Suite: Run the installer and follow the on-screen prompts to complete the lightweight installation.
  3. 3. Open Your Spreadsheets: Set WPS Spreadsheet as your default program to instantly open and edit any XLSX files generated by your database.
Fully compatible with Microsoft Excel XLSX and XLS formatsLightweight architecture ensures fast loading of large spreadsheet exportsFamiliar ribbon user interface requires zero learning curveBuilt-in tools for advanced data analysis and PDF conversion
microsoft office alternative - wps office

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.