How to Remove Underscore from Access Exported Worksheet Name
Question details
The user needs to export data from a Microsoft Access database to an Excel workbook without having an underscore automatically appended to the target worksheet name.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Exporting database records to a spreadsheet using the DoCmd.TransferSpreadsheet method.
- Observed behavior
- Microsoft Access automatically inserts an underscore into the worksheet name (e.g., Export_Worksheet) instead of outputting the exact requested name (e.g., ExportWorksheet).
Ensure you have administrative or edit access to the Access database VBA code and verify that the target Excel workbook is not currently open or locked by another user.
Use Excel Automation to Rename the Worksheet After Export
Export the data using your standard method, then use VBA Excel automation to safely rename the worksheet and remove the underscore.
Since the DoCmd.TransferSpreadsheet method does not reliably allow you to rename the generated worksheet during the export process, the most effective workaround is to let Access perform the export, and then programmatically open the file to adjust the name.
Run your standard DoCmd.TransferSpreadsheet command to output the file to your designated directory.
In your Access VBA module, create an instance of the Excel application using CreateObject("Excel.Application").
Use the Workbooks.Open method in your code to open the newly exported Excel file.
Target the specific worksheet and set its .Name property to "ExportWorksheet" (removing the underscore).
Save the workbook and quit the Excel application object to finalize the change.
Pre-create the Workbook with the Correct Sheet Name
Avoid the renaming issue entirely by transferring the data into an existing workbook that already contains a properly named worksheet.
Use an SQL Query to Export Directly to Excel
Bypass the TransferSpreadsheet method completely by running a direct SQL SELECT INTO query to generate the desired output.
Manage Your Exported Spreadsheets Seamlessly with WPS Office
While Microsoft Access export quirks might require VBA workarounds, managing and analyzing your exported data shouldn't be difficult. WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office for all your spreadsheet, document, and presentation needs.
- 1. Download the Software: Visit the official WPS website and click the Download WPS Office Free button.
- 2. Install WPS Office: Run the downloaded installer and follow the simple on-screen instructions to set up the software.
- 3. Open Your Exported Data: Launch WPS Spreadsheet and easily open the .xls or .xlsx files you exported from Microsoft Access.

Frequently Asked Questions
Why does Microsoft Access add an underscore to my exported worksheet name?
When using the TransferSpreadsheet method, Access sometimes normalizes strings or reacts to naming conflicts by substituting spaces or certain characters with an underscore. This is often done to ensure the name complies strictly with older Excel worksheet naming conventions or underlying database driver requirements.
Does the TransferSpreadsheet method have a built-in parameter to rename sheets post-export?
No, the DoCmd.TransferSpreadsheet method does not feature a native parameter to rename a sheet after the transfer is complete. You must use Excel VBA automation from Access to change the name after the fact.
What happens if the target worksheet name already exists when exporting?
If the exact worksheet name exists and you use TransferSpreadsheet, Access will typically append the data to the existing sheet. However, if the arguments are specified incorrectly or the sheet structure differs drastically, Access may return a runtime error.
Can I open files exported by Microsoft Access in WPS Spreadsheet?
Yes, WPS Spreadsheet is fully compatible with standard Excel formats (.xls, .xlsx) and CSV files, which are the formats commonly generated by Microsoft Access data exports.




