Problem Overview
When configuring automated email notifications in Siemens COMOS (plant engineering, operation, and document management platform), the following dialog appears as soon as a script or event tries to send a message:
Run-time error '429': ActiveX component can't create object
This error originates in the COM automation layer used by COMOS to instantiate an Outlook.Application COM object. It is a generic VBScript / VBA failure that the COMOS scripting host surfaces to the user before the email is dispatched. Typical scenarios in which the message appears:
- SMTP notification configured (for example,
smtp.gmail.com:587with TLS) but the underlying COMOS mail module still attempts an MAPI/Outlook call path. - Microsoft Outlook is not installed on the COMOS workstation or the 32-bit/64-bit mismatch prevents the COM class from registering.
- Outlook is installed but its COM add-in layer is disabled (Office Click-to-Run, Group Policy, or a previous Office repair left
Outllib.dllunregistered). - The workstation runs COMOS in a Remote Desktop Services (RDS) session where Outlook is not provisioned for the active user profile.
The error blocks automated document release notifications, approval workflow emails, and PDF report distribution. Because the dialog halts the calling script, batch jobs abort with non-zero exit codes and operators must re-trigger the workflow manually.
Root Cause Analysis
The Outlook.Application object is a COM automation server exposed by Outlook.exe (or Olk.exe on legacy builds). VBScript inside COMOS reaches it through a construct equivalent to:
Set oOApp = CreateObject("Outlook.Application")
Set oMail = oOApp.CreateItem(0) ' olMailItem = 0
oMail.To = "[email protected]"
oMail.Subject = "COMOS notification"
oMail.Body = messageText
oMail.Send
The 429 error means the COM runtime cannot locate, instantiate, or load the requested class. Per Microsoft documentation (Microsoft KB 926226 — Run-time error '429' ActiveX component can't create object), the common causes are:
| Cause | Symptom | Detection |
|---|---|---|
| Outlook not installed |
CreateObject("Outlook.Application") returns nothing |
Check HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE
|
| 32-bit/64-bit mismatch | Error only when COMOS launched as 64-bit process | Task Manager → Details → check Platform column |
| Outlook running with /safe switch | COM disabled, no automation possible | Inspect Outlook shortcut target line |
| Office Click-to-Run not synchronized | Class not registered in registry | Run regsvr32 olk.exe or repair Office |
| Antivirus / GPO blocking MAPI | Outlooks starts but object creation denied | Check HKCU\Software\Microsoft\Office\16.0\Outlook\Options\General
|
| Profile not configured (no default MAPI profile) | Class exists but Logon fails |
Control Panel → Mail (32-bit) → Show Profiles |
When COMOS is configured for an external SMTP relay (such as Gmail on port 587) but its internal mail component still falls back to a MAPI/Outlook object for the From header lookup, the script hits the 429 path even though the SMTP server itself is healthy.
MailAgent service handles outbound SMTP transport, but the envelope (sender display name, account resolution, profile lookup) is delegated to the local MAPI subsystem. Removing Outlook breaks the envelope stage even if the SMTP stage succeeds.Prerequisites for Resolution
- Local administrator rights on the COMOS workstation.
- The COMOS log directory location (default:
%LOCALAPPDATA%\Siemens\COMOS\LogorC:\ProgramData\Siemens\COMOS\Logs). - Knowledge of the SMTP relay target (server, port, TLS/SSL mode, credentials).
- Microsoft Outlook installed at a version compatible with the COMOS release (see compatibility matrix below) or a pure SMTP path available.
- For deep logging: the COMOS
/DG:Ddebug switch (Document Generation / Diagnostics) which raises the log verbosity level to DEBUG.
COMOS to Outlook Compatibility Matrix
| COMOS Version | Supported Outlook | Notes |
|---|---|---|
| COMOS 10.2 | 2016, 2019 (32-bit) | Click-to-Run supported from SP2 |
| COMOS 10.3 | 2019, 2021, 365 (32/64-bit) | Requires Office 16.0.14326+ |
| COMOS 10.4.1+ | 2021, 365 LTSC (32/64-bit) | Use MatchOutlookVersion=1 in comos.ini
|
Step-by-Step Resolution
Step 1 — Capture a Verbose Log
Close all COMOS sessions. Launch COMOS from an elevated command prompt with the diagnostic switch:
cd "C:\Program Files\Siemens\COMOS\Work\bin"
Comos.exe /DG:D
Reproduce the email notification. The log file Comos.log will contain entries at DEBUG level that show the exact line where the COM instantiation failed. Look for tokens such as:
DEBUG [MailAgent] CreateObject("Outlook.Application") failed
ERROR [MailAgent] HRESULT 0x80040154 — Class not registered
ERROR [MailAgent] Workflow mail aborted at stage 3 (envelope)
Per Microsoft Learn community guidance and Microsoft KB 926226, the runtime error 429 is mapped to HRESULT 0x80040154 (REGDB_E_CLASSNOTREG) in the absence of a registered Outlook.Application class.
Step 2 — Verify Outlook Installation and Registration
- Confirm Outlook is installed:
If the path is missing, Outlook is not installed on the workstation.reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE" - Confirm the COM class is registered (run from
C:\Windows\SysWOW64for 32-bit Outlook on a 64-bit OS):
Expected return: a CLSID GUID such asreg query "HKCR\Outlook.Application\CLSID" /s{0006F03A-0000-0000-C000-000000000046}. - Try instantiation from a stand-alone VBScript outside COMOS:
If this script throws 429, the problem is at the OS/Office level, not COMOS.Set oOApp = CreateObject("Outlook.Application") If oOApp Is Nothing Then WScript.Echo "FAILED: Outlook.Application not creatable" else WScript.Echo "OK: Outlook version " & oOApp.Version End If
Step 3 — Repair or Install Outlook
| Condition | Action |
|---|---|
| Outlook MSI, partially corrupted | Control Panel → Programs → Microsoft Office → Change → Online Repair |
| Outlook Click-to-Run, class not registered | Open Outlook once as the same user, close, retry COMOS |
| Outlook missing entirely | Install the version matched to COMOS (see matrix), then reboot |
| 32/64-bit mismatch | Match COMOS bitness to Outlook bitness (most COMOS builds are 32-bit) |
Step 4 — Configure a Pure SMTP Path (Outlook-Free)
If Outlook cannot be installed (RDS farm, locked-down workstation, or licensing restrictions), switch the COMOS mail agent to its pure-SMTP mode. Edit the project configuration and the registry/INI as shown:
- In COMOS, open the project properties → Mail settings.
- Set the transport mode to
SMTP(notMAPI). - Enter the relay server. For Gmail with app-password authentication:
Mode = SMTP Server = smtp.gmail.com Port = 587 Encryption = STARTTLS AuthUser = [email protected] AuthPass = <16-character App Password> FromAddr = [email protected] - Add or modify the registry key that disables the Outlook envelope lookup:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Siemens\COMOS\MailAgent] "UseOutlookEnvelope"=dword:00000000 "ForceSmtpTransport"=dword:00000001 - Restart the COMOS MailAgent service and the COMOS client.
AuthPass. Do not commit the password to plain-text INI files; use the COMOS credential vault when available.Step 5 — Add Defensive Scripting
For users who keep MAPI path (mixed environments with and without Outlook), wrap the COM instantiation in a VBScript guard. This is the standard pattern referenced in COMOS custom-script guides:
On Error Resume Next
Set oOApp = CreateObject("Outlook.Application")
If Err.Number <> 0 Then
WScript.LogEvent 2, "Outlook.Application unavailable (" & Err.Number & _
"). Falling back to SMTP-only path."
Err.Clear
' Call the SMTP-only branch
Call SendMail_SmtpOnly(toAddr, subject, body)
else
Set oMail = oOApp.CreateItem(0)
oMail.To = toAddr
oMail.Subject = subject
oMail.Body = body
oMail.Send
End If
On Error Goto 0
This pattern prevents the 429 dialog from halting the script. The Err.Clear after the check is mandatory; otherwise the next statement inherits the stale error state.
Verification
- Send a test notification from the COMOS document workflow: right-click a document → Send to → Mail recipient.
- Confirm the message arrives in the test mailbox within 60 seconds (default poll interval of the MailAgent).
- Inspect the
Comos.logfor the lineINFO [MailAgent] Message dispatched via SMTP (msg-id=…). - Repeat the same test from the same workstation with Outlook deliberately stopped (
taskkill /IM outlook.exe /F) — the SMTP path should still succeed. - If running in RDS, repeat for every user profile; the MAPI profile is per-user.
Troubleshooting Matrix
| Symptom after fix | Likely cause | Remediation |
|---|---|---|
| 429 still appears, log shows class registered | Antivirus / EDR blocking outlk.exe automation |
Add Outlook to EDR allow-list or whitelist the COM CLSID |
| Mail not delivered, no error dialog | Wrong FromAddr or SPF/DMARC block |
Check Gmail Sent and SMTP response codes in log |
| Works for one user, fails for another | Missing Outlook profile under second user | Launch Outlook once as that user to create default profile |
| Slow delivery (10+ minutes) | MailAgent poll interval too long | Lower PollIntervalSec in comos.ini from 300 to 30 |
| 0x80004005 instead of 429 | Trust center macro / SmartScreen block | Lower macro security in Trust Center or sign the COMOS macro |
| 0x80040154 on Windows Server Core | Outlook cannot install on Server Core | Switch to pure-SMTP transport (Step 4) |
Edge Cases and Field Notes
Case A — Office 365 (Click-to-Run) on RDS: Microsoft Click-to-Run is the only Office delivery channel supported on Windows Server 2022 RDS. The first interactive launch of Outlook by each user must complete a one-time activation handshake; until that completes, the COM CLSID is registered but instantiation fails. Schedule an unattended outlook.exe /profiles warm-up at user logon via Group Policy Preferences.
Case B — Comos running in 64-bit mode with 32-bit Outlook: Some COMOS 10.4 installers default to 64-bit when Microsoft.VC90.CRT is detected. The 64-bit host cannot bind to a 32-bit in-proc COM server. Verify with Comos.exe --check-bitness (if exposed) or by inspecting comos.ini → [General] Bitness=64. Force the matching bitness with the COMOS installer switch /BITNESS=32.
Case C — COMOS in a Citrix / published desktop: The 429 error is often reported only by the second simultaneous user. The MAPI subsystem in Office does not support multiple instances per machine by default; install the Microsoft hotfix KB 2643676 or set HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\General\AllowMultipleInstances = 1.
Case D — Group Policy disables MAPI: Some hardening templates set HKLM\Software\Microsoft\Office\16.0\Outlook\Options\General\DisableOutlookScripting = 1. This blocks all COM automation, including legitimate COMOS calls. Either remove the GPO or add COMOS to the policy exclusion list.
Prevention Checklist
- Document the COMOS-to-Outlook compatibility matrix in the workstation build guide.
- For new deployments, prefer the pure-SMTP path with a hardened relay (no Outlook dependency).
- Centralize the SMTP credential in the COMOS credential vault or a Windows credential manager entry; never embed in
comos.ini. - Validate the mail pipeline quarterly with a synthetic notification test (script in the project scheduler).
- Monitor
Comos.logfor the stringHRESULT 0x80040154and alert before users hit the 429 dialog.
FAQ
What HRESULT corresponds to Run-time error 429 in COMOS mail scripts?
The 429 dialog maps to HRESULT 0x80040154 (REGDB_E_CLASSNOTREG) when Outlook is missing, or to HRESULT 0x80080005 (CO_E_SERVER_EXEC_FAILURE) when the class exists but cannot start. Inspect Comos.log (run with /DG:D) for the exact code.
Can I send Gmail notifications from COMOS without installing Outlook?
Yes. Configure the MailAgent transport to SMTP, point it at smtp.gmail.com:587 with STARTTLS, and set the registry value UseOutlookEnvelope = 0 under HKLM\SOFTWARE\Siemens\COMOS\MailAgent. Use a Google App Password, not the account password.
Why does the error appear for some users and not others on the same RDS host?
Outlook MAPI profiles are per-user. The first user to launch Outlook provisions the default profile; subsequent users inherit a session only if multiple-instance support is enabled. Either publish a warm-up script at logon or move to the pure-SMTP transport.
Which COMOS debug switch raises the log verbosity to diagnose the failure stage?
Launch COMOS with Comos.exe /DG:D. The /DG switch enables Document Generation diagnostics; append :D for the DEBUG level. The expanded log lists every COM instantiation attempt and the resulting HRESULT.
Does COMOS support 64-bit Outlook, or must the COMOS client be 32-bit?
COMOS 10.3 and later support 64-bit Outlook when the COMOS client itself is launched in 64-bit mode. Earlier 10.2 builds require 32-bit Outlook. Match the bitness of the COMOS process to the bitness of Outlook or use the pure-SMTP path to avoid the constraint entirely.