logo
search
VBA & Macro Problems

Fix Access VBA Error: Cannot Find Excel Attachment File

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

Question details

The user needs to resolve a runtime error in an Access database application where a VBA script fails to find and attach a newly generated Excel workbook to an Outlook email, triggered by a new sensitivity label requirement.

Product
Microsoft Access / Excel / Outlook
Device & OS
not provided
Scenario
Automating the creation of an Excel workbook on a network drive from an Access database and attaching it to an Outlook email using VBA.
Observed behavior
The VBA process successfully opens the Outlook email but omits the attachment, returning the error message: "Cannot find this file. Verify the path and file name are correct."
Before you start

Ensure you have read and write permissions to the designated network drive and verify the exact sensitivity label requirements mandated by your organization's IT policies.

Solution 1Recommended

Use a Pre-Labeled Excel Template

Bypass the VBA labeling limitations by creating a blank template that already contains the required sensitivity label.

When an organization mandates sensitivity labels, VBA scripts attempting to create and save new Excel workbooks from scratch will often fail to save the file to the disk. As a result, when the script tells Outlook to attach the file, the file does not actually exist at the specified path, throwing the runtime error. Using a pre-labeled template is the most robust workaround.

1
Create a blank workbook

Open a new, blank Excel workbook on your computer and manually apply the required sensitivity label via the Home tab or File menu.

2
Save the template

Save this labeled workbook as a template file (e.g., Template.xlsx) in your database folder or network drive where the Access application resides.

3
Modify the Access VBA code

Update your VBA script to copy this template file to the target destination instead of creating a new workbook using 'Workbooks.Add'.

4
Write data and attach

Have the code open the copied, labeled workbook, insert the imported text data, save the changes, and then pass the file path to the Outlook attachment method.

Reliable Automation: This method ensures the sensitivity label is always present, preventing silent save failures and resolving the Outlook attachment error.
Free Microsoft Office alternative

Experience Hassle-Free Macros with WPS Office

If strict enterprise labeling policies and Microsoft Office version discrepancies are breaking your legacy VBA workflows, consider WPS Office. It provides robust, highly compatible spreadsheet automation capabilities in a lightweight, accessible suite.

  1. 1. Download and Install: Get the free version of WPS Office from the official website and install it on your machine.
  2. 2. Open your macro-enabled file: Launch WPS Spreadsheet and open your .xlsm or .xls files directly without losing formatting.
  3. 3. Run your scripts: Access the Developer tab to manage and run your VBA macros efficiently.
Seamlessly compatible with Microsoft Excel formats (.xlsx, .xlsm, .xls).Excellent support for advanced spreadsheet macros and VBA functions.Lightweight architecture ensures stable performance even on older systems or remote desktops.Completely free core features with a familiar, easy-to-use interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Access VBA say 'Cannot find this file' right after creating it?

This error occurs when the Excel application is prevented from saving the file to your hard drive or network path. Recently implemented security policies, such as mandatory sensitivity labels, will silently block the save operation. When your code later attempts to attach the file to Outlook, the file doesn't actually exist at the specified path.

Can I apply Microsoft sensitivity labels directly using VBA?

Yes, but this typically requires newer Office versions like Microsoft 365. You can use the Office SensitivityLabel API to assign a specific label ID. However, older environments like Office 2016 might not support these API calls, leading to macro failures.

What is the best way to bypass sensitivity label prompts in automated Access macros?

The most reliable, version-independent method is to create a blank Excel template manually, assign it the required sensitivity label, and save it. You can then modify your Access VBA code to copy this template file and write data into it, completely bypassing the need to apply labels programmatically.