The alert Runtime Error 429: ActiveX component can't create object appears when a VBA procedure attempts to instantiate the FileSystemObject via CreateObject("Scripting.FileSystemObject") or New FileSystemObject, but the Windows operating system fails to register, locate, or authorize the Microsoft Scripting Runtime library.
Quick Answer
If running on Windows, re-register the scripting engine by opening Command Prompt as Administrator and running
regsvr32.exe scrrun.dll. If the error occurs on macOS, rewrite the code using native VBA file functions (Dir,Open,FileCopy), because ActiveX and the Scripting Runtime do not exist on Unix operating systems.
Why the Error Occurs
The FileSystemObject (FSO) is part of the Microsoft Scripting Runtime library (scrrun.dll). It is not an internal component of the VBA language; it is an external COM (Component Object Model) server provided by Windows.
When your code executes:
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Excel queries the Windows Registry (HKEY_CLASSES_ROOT\Scripting.FileSystemObject\CLSID) to locate the dynamic link library responsible for the object. Error 429 occurs if:
- The workbook is executing on a platform that does not support COM (macOS).
- The registration for
scrrun.dllis missing, damaged, or unmapped in the Windows Registry. - System security software, Application Whitelisting (AppLocker), or Group Policy blocks the Windows Script Host from instantiating COM objects.
- An early-bound reference in the VBA project points to a missing or version-mismatched type library.
Step-by-Step Diagnostic Path
Follow this structured diagnosis to identify the source of the breakdown:
Runtime Error 429 on FileSystemObject
│
Is the machine running macOS?
╱ ╲
YES ╱ ╲ NO
╱ ╲
ActiveX is unsupported Is the code using Early Binding
on Mac. Use native VBA or Late Binding?
file statements. ╱ ╲
Early Binding ╲ Late Binding
╱ ╲
Check Tools > References: Re-register scrrun.dll via
Is MS Scripting Runtime Admin Command Prompt;
missing or broken? check security software.
Step 1: Verify the Operating System
ActiveX is a proprietary Windows technology. Excel for Mac does not include the COM subsystem, meaning any call to CreateObject("Scripting.FileSystemObject") fails on macOS immediately.
- The Resolution: If your workbook must support Mac users, replace FSO methods with native cross-platform VBA commands:
- Replace
fso.FileExists(path)withLen(Dir(path)) > 0 - Replace
fso.DeleteFile(path)withKill path - Replace
fso.CreateFolder(path)withMkDir path - Replace
fso.CopyFile(src, dest)withFileCopy src, dest
- Replace
For details on managing mixed environments safely, see Troubleshooting Mac vs. Windows VBA compatibility (ActiveX vs. AppleScript).
Step 2: Re-Register the Scripting Library in Windows
If the error occurs on Windows, the COM registration mapping for scrrun.dll is likely damaged.
- Close Excel completely.
- Click the Windows Start menu, type
cmd, right-click Command Prompt, and select Run as administrator. - For standard 64-bit Windows installations running 64-bit Office (or 32-bit Windows):
regsvr32.exe %windir%\system32\scrrun.dll - For 64-bit Windows running 32-bit Office:
regsvr32.exe %windir%\syswow64\scrrun.dll - Press Enter. You should see a confirmation dialog: “DllRegisterServer in scrrun.dll succeeded.”
- Re-open Excel and run the macro.
If you encounter general COM registration failures across multiple automation libraries, see Runtime Error 429: ActiveX component can’t create object (Broken DLLs).
Step 3: Repair Missing Early-Bound References
If your code uses early binding (Dim fso As New FileSystemObject or Dim fso As Scripting.FileSystemObject), the VBA project depends on an explicit reference set in the project properties. If that reference becomes unmapped, compilation fails with Error 429 or “User-defined type not defined”: Missing library references (Tools > References).
- The Fix:
- Open the VBA Editor (
Alt + F11). - Click Tools > References.
- Scroll through the selected items at the top of the list. Look for any item marked
MISSING: Microsoft Scripting Runtime. - If marked missing, uncheck it, scroll down, check the valid Microsoft Scripting Runtime entry pointing to
scrrun.dll, and click OK. - Alternatively, switch to late binding to eliminate project reference dependencies entirely:
Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject")
- Open the VBA Editor (
Step 4: Verify Group Policy and Script Host Restrictions
In locked-down corporate IT environments, administrators may disable the Windows Script Host (WSH) through registry keys to prevent script-based attacks.
- The Diagnostic Check:
- Check the Windows Registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings - If a DWORD value named
Enabledis present and set to0, COM object instantiation for scripting libraries is blocked globally. - If your company restricts scripting runtimes via Group Policy, you cannot use
Scripting.FileSystemObject. You must refactor your macro to use native VBA file-handling statements.
- Check the Windows Registry key:
If the file you are attempting to interact with via FSO is stored in a synchronized cloud folder, ensure the path itself is formatted correctly by reviewing Fixing VBA errors caused by “OneDrive” autosave and temp file paths.