When VBA throws Run-time error 429: ActiveX component can’t create object on a line calling CreateObject("Scripting.FileSystemObject"), it means the Windows COM subsystem cannot locate, initialize, or execute the Microsoft Scripting Runtime component. This error occurs because Excel is running on macOS (which does not support ActiveX/COM), the underlying system DLL is unregistered or corrupted, system permissions are blocking the script host, or 32-bit and 64-bit registration entries have drifted after an Office update.
Quick Fix
If you are running Excel on Windows, verify your syntax and re-register the scripting runtime DLL by first closing Excel completely, opening an elevated Command Prompt (Windows Key > search
cmd> right-click and select Run as administrator), running the commandregsvr32.exe scrrun.dll, confirming theDllRegisterServer in scrrun.dll succeededmessage appears, and then reopening your workbook to run the macro.
Step-by-Step Diagnostic Path
If the quick fix does not resolve the error, use the following progressive troubleshooting steps to identify the root cause.
[Run-time Error 429]
│
Is Excel running on macOS?
├── YES ──► Use Dir/MacScript/AppleScript
└── NO
│
Does "regsvr32 scrrun.dll" succeed?
├── NO ──► Check system integrity (SFC)
└── YES
│
Does Late Binding fail despite registration?
├── YES ──► Test Early Binding (Reference Check)
└── NO ──► Verify Bit-level registration
1. Verify the Operating System (macOS vs. Windows)
The Scripting.FileSystemObject (FSO) object model is a Windows-only ActiveX component compiled inside scrrun.dll. It does not exist in macOS versions of Excel.
- Symptom: The error triggers instantly on macOS when executing
Set fso = CreateObject("Scripting.FileSystemObject"). - Action: Replace FSO-based calls with native VBA file handling methods such as
Dir(),Get,Put,Open,FileCopy, andKill, or branch execution based on the operating system:
VBA
#If Mac Then
' Use native VBA or AppleScript on Mac
Dim folderPath As String
folderPath = Dir(Environ("HOME") & "/*", vbDirectory)
#Else
' Windows COM implementation
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
#End If
For Mac-specific cross-platform automation and environment-specific file access, see Troubleshooting Mac vs. Windows VBA compatibility (ActiveX vs. AppleScript).
2. Resolve Bit-Architecture and Registry Discrepancies
On 64-bit editions of Windows, 32-bit and 64-bit COM objects live in separate registry hives and system directories. If you run 32-bit Office on 64-bit Windows (or vice versa), registration can point to the incorrect system path.
- For 64-bit Office on 64-bit Windows or 32-bit Office on 32-bit Windows, register the 64-bit / standard system file:
regsvr32.exe C:\Windows\System32\scrrun.dll - For 32-bit Office on 64-bit Windows, explicitly register the 32-bit runtime file:
C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\scrrun.dll
If regsvr32 returns error code 0x80070005 (Access Denied), ensure your command prompt was opened with administrative privileges. If it returns 0x80004005 or file not found, the DLL is missing from your system directory.
3. Test Early Binding vs. Late Binding
Switching from late binding (CreateObject) to early binding (referencing the library directly) helps isolate whether the failure stems from dynamic COM object creation or a missing/broken type library.
- Open the VBA Editor (Alt + F11).
- Click Tools > References.
- Scroll down and check Microsoft Scripting Runtime.
- Click OK.
- Update your code declaration:
VBA
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
- If the code compiles and runs: The type library is functional, but programmatic ID resolution (
Scripting.FileSystemObject) in the Windows registry was corrupt or blocked. You can safely keep early binding. - If you see “MISSING: Microsoft Scripting Runtime” or a compile failure: The library reference is broken at the Office level. Consult Troubleshooting VBA library “Missing” errors after an Office update to repair damaged reference links.
- If you see a compile error “User-defined type not defined”: See “User-defined type not defined”: Missing library references (Tools > References).
Hidden Conditions & Next Steps
If re-registering scrrun.dll and checking library references fail to resolve Error 429, check these underlying system conflicts:
- Corrupted System Binaries: Run
sfc /scannowin an administrative Command Prompt to repair damaged Windows core files. - Security Software and Group Policy Restrictions: Enterprise Endpoint Detection and Response (EDR) software or Group Policies targeting Windows Script Host (WSH) can block
scrrun.dllexecution inside Microsoft Office applications. If the issue affects multiple users across an organization, confirm with IT whether COM activation for script runtimes has been restricted. - General ActiveX Subsystem Failures: If other objects (like
WScript.ShellorADODB.Connection) also fail with Error 429, the root issue is broader than FileSystemObject. See Runtime Error 429: ActiveX component can’t create object (Broken DLLs) for complete COM subsystem repair steps.