Resolving 'ActiveX Component Cannot Create Object' in WinCC V7.3 OLE-DB Alarm Archiving

Resolving 'ActiveX Component Cannot Create Object' in WinCC V7.3 OLE-DB Alarm Archiving

In SIMATIC PCS 7 V8.1 (WinCC V7.3), runtime error 'ActiveX component can\'t create object' during OLE-DB alarm extraction occurs when a 64-bit application attempts to instantiate 32-bit WinCC COM objects, or when CCMsgOledb.dll is unregistered. Resolve this by executing export scripts under the 32-bit Windows script host (SysWOW64\wscript.exe), deploying 32-bit Microsoft Office, registering WinCC OLE-DB DLLs, and verifying WinCC/Connectivity Pack licensing.

Table of Contents

Diagnostic Overview and COM Instantiation Failure

In SIMATIC PCS 7 V8.1 and WinCC V7.3 operating on 64-bit operating systems (Windows 7 SP1 64-bit or Windows Server 2008 R2 / 2012 R2), engineers deploy custom export utilities, Microsoft Excel VBA macros, or VBScript applications to retrieve historical process data and alarm logs via the WinCC OLE-DB Provider.

A recurring error halts automated reporting:
* The utility connects to the WinCC SQL Server database and successfully extracts historical process tags from TagLogging.
* When the script invokes the alarm query method (e.g., clicking a 'Read Area' or 'Read Alarms' button), the runtime execution halts with Microsoft VBScript runtime error 429:
Area determination failed: ActiveX component can't create object.
* The tag query functions cleanly, but the alarm query engine fails completely.

This failure indicates that while general SQL OLE-DB providers operate natively, the specific COM component responsible for WinCC Alarm Logging area mapping and message archive decoding cannot be loaded into the calling process address space.

Root Cause Analysis: 32-Bit COM vs 64-Bit Host Architecture

The failure is driven by COM architecture constraints, DLL registration integrity, and software licensing:

  1. Process Bitness Mismatch (32-Bit COM in 64-Bit Host):
    * WinCC V7.3 runtime binaries and OLE-DB client providers—including CCMsgOledb.dll (Alarm Logging provider) and CCTlgOledb.dll (Tag Logging provider)—are compiled as 32-bit dynamic link libraries.
    * On 64-bit Windows, double-clicking a .vbs script launches the 64-bit script host (C:\Windows\System32\wscript.exe). Similarly, running 64-bit Microsoft Office executes VBA inside a 64-bit memory space.
    * A 64-bit host process cannot load 32-bit in-process COM DLLs. When CreateObject("CCMsgOledb.CCMsgArea") or similar factory methods are called, the OS fails to create the object and throws Error 429.

  2. Unregistered or Missing COM DLLs:
    * During third-party utility installation or post-Windows update cycles, registry entries under HKEY_CLASSES_ROOT\CLSID for the WinCC Message OLE-DB objects may become corrupted or unregistered.
    * Unlike standard Microsoft SQL providers, WinCC requires explicit registration of CCMsgOledb.dll located in the WinCC bin directory.

  3. WinCC/Connectivity Pack Licensing Requirements:
    * External extraction of WinCC archives via the OLE-DB Provider requires the WinCC/Connectivity Pack license. Without this license installed in Automation License Manager (ALM), the provider operates in demo mode or restricts functional interfaces.

Step-by-Step Resolution and Registration Procedure

1. Force Execution under the 32-Bit Script Host

  1. Never launch OLE-DB extraction scripts by double-clicking on a 64-bit Windows system.
  2. Open an elevated Command Prompt.
  3. Launch the script explicitly using the 32-bit Windows Scripting Host:
    cmd C:\Windows\SysWOW64\wscript.exe "C:\Cielo2\Tools\tag_and_alarm_export.vbs"
  4. If utilizing Microsoft Excel for VBA data extraction, install the 32-bit version of Microsoft Office, which natively loads 32-bit WinCC COM automation objects.

2. Re-register WinCC Message OLE-DB Libraries

  1. Close all running WinCC, Excel, and script instances.
  2. Open Command Prompt as Administrator (cmd.exe).
  3. Navigate to the 32-bit Windows system directory and register the core WinCC alarm provider DLL:
    cmd cd /d "C:\Program Files (x86)\Siemens\WinCC\bin" regsvr32.exe CCMsgOledb.dll regsvr32.exe CCTlgOledb.dll regsvr32.exe WinCCOleDBProvider.dll
  4. Confirm that Windows displays a DllRegisterServer in CCMsgOledb.dll succeeded confirmation dialog.

3. Verify Connection String Syntax

Ensure your VBScript or ADO connection string adheres to the official WinCC OLE-DB syntax:

Dim conn, connStr
Set conn = CreateObject("ADODB.Connection")
connStr = "Provider=WinCCOLEDBProvider.1;Catalog=CC_External_Project;Data Source=.\WINCC"
conn.Open connStr

4. Verify WinCC Connectivity Pack License in ALM

  1. Open Automation License Manager.
  2. Verify that a valid license for SIMATIC WinCC/Connectivity Pack V7.3 (MLFB 6AV6371-1DH07-3AX0) is active on the local machine.
  3. If missing, transfer the license key from your license media.

WinCC OLE-DB Provider Component and Compatibility Matrix

Component NameFile PathBitnessTarget ArchiveTypical Error if Missing / MisconfiguredCCMsgOledb.dll%SiemensPath%\WinCC\bin\32-bitAlarm Logging (Alarms & Messages)ActiveX component can't create object (Error 429)CCTlgOledb.dll%SiemensPath%\WinCC\bin\32-bitTag Logging (Slow & Fast Archives)Provider cannot be found / Query failedWinCCOleDBProvider.dll%SiemensPath%\WinCC\bin\32-bitMaster Connection FactoryClass not registered (Error 80040154)Microsoft wscript.exe (SysWOW64)C:\Windows\SysWOW64\32-bitScript Execution HostResolves 32-bit COM in-process loadingMicrosoft wscript.exe (System32)C:\Windows\System32\64-bitIncompatible with 32-bit COMThrows ActiveX Error 429 on 32-bit DLLs

Verification

  1. Open Command Prompt and execute your export script using C:\Windows\SysWOW64\wscript.exe.
  2. Click the Read Area button in the utility interface.
  3. Confirm that no ActiveX runtime errors occur.
  4. Verify that historical alarm records populate the target CSV or Excel sheet with valid timestamps, message numbers, message texts, and alarm states (COME, GO, ACK).
  5. In ALM, verify zero license violation popups are generated during data reading.

Limitations and Operational Precautions

  • High Query Load Warning: Executing expansive historical alarm queries spanning multiple gigabytes without date filters (DateTime > ... AND DateTime < ...) can exhaust SQL Server buffers and cause WinCC Runtime operator station sluggishness.
  • Database Write Prohibition: Never attempt to write, modify, or delete records in WinCC SQL archive tables using SQL INSERT, UPDATE, or DELETE commands. Tampering with tables directly will corrupt the archive catalog.
  • Licensing Disclaimer: Sourcing the WinCC/Connectivity Pack or Connectivity Station requires purchasing specific software licenses. Confirm MLFBs (6AV6371-1DH07-3AX0) and options with an authorized Siemens distributor.

Engineer FAQ

Why did reading process tags work while reading alarms failed in the same script?

Tag logging queries often execute via standard SQL OLE-DB drivers or basic ADO recordsets. Alarm reading requires the proprietary CCMsgOledb COM helper to decode message classes and area hierarchies, which triggers Error 429 if bitness mismatches.

Can I use 64-bit Python or 64-bit PowerShell to query WinCC OLE-DB?

No, you must use 32-bit Python (python-32) or 32-bit PowerShell (C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe) because in-process COM DLLs require matching host bitness.

Where can I find the official documentation for WinCC OLE-DB SQL query syntax?

The query syntax for tags (TAG:R,...) and alarms (ALARMVIEW:SELECT...) is detailed in the WinCC Information System manual under 'Communication > WinCC Connectivity Pack'.

Technical References

Related Articles

Related Tags

  • WinCC V7.3
  • OLE-DB
  • ActiveX Error 429
  • Connectivity Pack
  • SysWOW64
  • Alarm Archiving
6 respuestas