How to Stop Microsoft Word Security Prompts in Excel VBA Macros
Question details
Stop security warning prompts when using an Excel VBA macro to copy linked content from a Word document to an Outlook email.

- Product
- Microsoft Excel VBA
- Device & OS
- not provided
- Scenario
- An Excel macro is automating the process of copying content from a Microsoft Word document into a Microsoft Outlook email.
- Observed behavior
- A security warning is triggered because the Word document contains links, causing the macro automation to halt and wait for user confirmation.
Before modifying your Microsoft Office security settings, verify that the macro and the linked Word documents originate from a fully secure and trusted source to prevent accidental execution of malicious code.
Store the Word Document in a Trusted Location
Designating the folder where your Word documents reside as a Trusted Location in the Trust Center is the safest and most reliable way to bypass security prompts without compromising overall security.
By setting up a Trusted Location, Microsoft Office automatically assumes any file opened from that specific directory is safe, bypassing standard link and macro warnings.
Launch Microsoft Word, click on the File tab in the top-left corner, and select Options at the bottom of the menu.
In the Word Options dialog box, click on Trust Center in the left-hand pane, then click the Trust Center Settings button on the right.
Select Trusted Locations from the left menu, click the Add new location button, and browse to the folder containing your Word documents.
Check the box for 'Subfolders of this location are also trusted' if necessary, click OK to confirm the new location, and click OK again to close the Trust Center.

Digitally Sign the VBA Project
Applying a valid digital signature to your VBA macro ensures that Office trusts the code executing across applications, potentially suppressing unauthorized access prompts.
Why You Should Avoid the SendKeys Method
Many developers attempt to use VBA's Application.SendKeys function to automatically press 'Enter' or 'Y' when the prompt appears. This method is highly discouraged due to stability and security risks.
Try WPS Office for Seamless Macro Execution and Document Compatibility
If persistent Microsoft Office security prompts continue to disrupt your automated VBA workflows, consider switching to WPS Office. It offers robust VBA support, high compatibility with standard Office files, and an intuitive interface to streamline your macro operations without the hassle.

Frequently Asked Questions
Can I use Application.DisplayAlerts = False to bypass this Word security prompt?
No. While Application.DisplayAlerts works for standard application warnings (like confirming a deletion), it does not override security-level prompts generated by the Office Trust Center regarding external links or macro execution.
Why does a Word document with links cause a prompt in an Excel macro?
When Excel uses VBA to open a Word document, Word's security protocols independently check the document. If the document contains external links to other files or web data, Word halts to ask the user if those links should be updated or trusted, causing the automation to pause.
Are Trusted Locations secure to use?
Yes, provided you maintain strict control over what goes into the Trusted Location. You should only store files created by trusted sources in that folder, as any file in a Trusted Location bypasses standard Office security checks.
Does saving the file as an .xlsm macro-enabled workbook fix the warning?
No. Saving the Excel file in the correct macro-enabled format (.xlsm) is required to run the macro, but the security warning is originating from the Linked Data types inside the target Word document, which is assessed separately by the Office Trust Center.




