Microsoft has blocked macros from running because the source of this file untrusted.

Yazar Burak Kurc

SECURITY RISK – Microsoft has blocked macros from running because the source of this file untrusted. If you’re running an Excel sheet from a shared network location you might encounter this error and Excel does not allow you to enable macros. This happens when Windows think shared location is unsafe. No worries we will fix this issue.

Want to try new Office 365?

You can try full features of Office 365 for free for one month. Click here to goto Office 365 site.

SECURITY RISK – Microsoft has blocked macros from running because the source of this file untrusted

Screenshot of the “SECURITY RISK – Microsoft has blocked macros from running because the source of this file untrusted.” error.

Things we’ll be doing

  • Editing the host file and specifying the name for the file server.
  • Adding the file server name to the Trusted sites list from the control panel.
  • Adding the file server to the trusted sources list from Excel.
  • Re-connecting the file server with FQDN (full server name).

Editing the host file

If you are accessing the file server via IP, Excel does not allow you to save it to the safe list as an IP. To resolve the IP as a name, we will create a random sub-domain (example: bkfs.bktest.com) name in the host file of Windows. If you can access by domain name (example: you can try to ping bkfs.bktest.com. Your environment may have a domain structure and/or DNS server, contact your system administrator to find out), you can skip this step.

If the file server is added as an IP, it will look like this.

Let’s open the run window by pressing the WIN (the key in the middle of the CTRL and ALT keys) + R keys at the same time and type the following and press enter.

C:\Windows\System32\drivers\etc
Windows run screenshot.
If you edit the host file where it is, Windows may give a permission error while saving. Therefore, it may be a practical solution to take the file to the desktop and edit it there and copy it back (overwrite) instead. You can use notepad to edit.
I chose a random name for the file server, you can give it whatever you want. The name you give should not be used elsewhere. I would like to point out that the host file has no extension, if notepad adds the txt extension while saving, delete it.

Adding the file server name to the Trusted sites list from the control panel.

This image has an empty alt attribute; its file name is excel-macro-hatasi-19.jpg
Let’s open the control panel by typing Control Panel in the Windows search box.
If it does not appear as in the picture, select the small icons, then click on internet settings.
Select the trusted sites as shown in the picture and click on the sites.
Register the file server as I show in the picture.

Adding the file server to the trusted sources list from Excel.

Let’s open a blank excel sheet, reach the above page from the file section and click Options.
From Trust Center, go to Trust Center Settings.
Activate the option above and click Add new location.
Add the server name we specified (in this case \bkfs.bktest.com\ ) to the Path section and activate the trust subfolders option.

Re-connecting the file server with FQDN (full server name).

In order for the settings to work smoothly, if the file server is added as an IP, we need to remove it and add it as a domain name. As I show in the picture, right click and click on Disconnect.
To add it again, select Map network drive from the top menu.
Type the name of the file server and the share in the Folder section and click OK. It may ask you to enter account information for access.
If everything is done correctly the file server will look like above. From now on, your excel files containing macros will be opened without any errors.

Yorum Bırak