Open in the explorer

Allow VBA to load typelib references by path from untrusted intranet locations

Type
User
GPO path
User Configuration › Policies › Administrative Templates › Microsoft Office 2016 › Security Settings
Supported on
At least Windows Server 2016, Windows 10
ADMX file
office16.admx
Internal name
office16/L_AllowVbaIntranetRefs

Explanation

This policy setting permits VBA to load typelib references by explicit path read from the project data if that path points to an intranet location that is not explicitly in the system trusted sites list.

By default, VBA will attempt to load typelibs referenced in a project by searching for the library GUID in the registry. If it is not found in the registry, VBA will attempt to load the typelib or project reference using the path stored in the project for the reference as long as the reference does not point to an internet or intranet location that is not in the trusted sites list.

If you enable this policy setting, VBA will treat intranet paths like local machine paths, and therefore VBA will attempt to search for unregistered references in intranet locations that are not local machine or in the system's trusted sites list.

If you disable or don’t configure this policy setting, VBA maintains its default behavior and will refuse to load typelibs on intranet paths if it does not find the typelib registered in HKEY_CLASSES_ROOT.

Registry

HKEY_CURRENT_USER\software\policies\microsoft\vba\security
Value name
allowvbaintranetreferences
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: office16/L_AllowVbaIntranetRefs
$k = 'HKCU:\software\policies\microsoft\vba\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'allowvbaintranetreferences' -Value 1 -Type DWord

Disable

# Disable: office16/L_AllowVbaIntranetRefs
$k = 'HKCU:\software\policies\microsoft\vba\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'allowvbaintranetreferences' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": office16/L_AllowVbaIntranetRefs
$k = 'HKCU:\software\policies\microsoft\vba\security'
Remove-ItemProperty -Path $k -Name 'allowvbaintranetreferences' -ErrorAction SilentlyContinue

Application

Microsoft 365 Apps / Office (Microsoft) — November 2026 templates

Official templates downloaded on November 12, 2026.