Resolving WinCC V7.3 cexcelrw Transparent Proxy Cast Error in Configuration Studio
1. Problem Summary
When triggering the Export or Import action in the WinCC Configuration Studio → Tag Management editor on a WinCC V7.3 system (specifically observed on V7.3.0.1), the operation terminates with the .NET runtime exception:
The fault is symmetric: it appears for both the export (writing the tag table to a .xlsx workbook) and the import (re-ingesting a .xlsx into the project). The same engineering station may have executed the workflow repeatedly and successfully, and a full Windows reboot does not clear the condition. This is a class-loading fault in the WinCC process, not a transient file-system or project-database error, and the root cause lives outside the WinCC project.
2. Affected Versions and Component Architecture
The Configuration Studio was introduced with WinCC V7.3 as the modern replacement for the legacy WinCC Explorer tag editor. The Excel-based import/export function was implemented on top of the Microsoft Open XML SDK 2.0 (assembly name DocumentFormat.OpenXml, version 2.0.5022.0 or a compatible 2.0.x service release), which is shipped inside the WinCC installer rather than treated as an Office dependency.
| Component | Version | Source / Path |
|---|---|---|
| WinCC Runtime / Configuration | V7.3.0.1 (V7.3 SP0), V7.3 SP1, V7.3 SP2, V7.4 up to SP1 | WinCC Setup DVD or HSP download |
| WinCC Configuration Studio | Built into V7.3 | CCConfigStudio.exe |
| Open XML SDK 2.0 | 2.0.5022.0 (build shipped with the medium) | X:\InstData\OpenXMLSDK\OpenXMLSDKv2.msi |
| .NET Framework | 4.0 / 4.5 (required by SDK 2.0) | OS / WinCC prereq |
| Microsoft Office | 32-bit only (2010 / 2013 / 2016) | Siemens compatibility matrix for V7.3 |
The internal class that raises the cast failure is cexcelrw (Siemens-internal Config Excel Reader/Writer helper). It is hosted inside CCConfigStudio.exe (32-bit) and wraps the Open XML SDK calls that serialize the tag table to an .xlsx workbook.
3. Root Cause Analysis: Why the Transparent Proxy Cannot Be Cast
In .NET Remoting (and in equivalent CLR mechanisms for cross-AppDomain and cross-process calls), when a client receives a reference to an object living in another AppDomain or process, the runtime hands the client a transparent proxy. The actual cast proxy → concrete type is performed on the first method invocation, and at that moment the CLR resolves the type metadata in the calling domain. The chain that breaks is:
-
CCConfigStudio.exerequests thecexcelrwtype from its own loaded assemblies. - The type metadata returned to the calling AppDomain belongs to a different version of
DocumentFormat.OpenXml.dllthan the one currently bound to the host process. - The transparent proxy is therefore a
RuntimeProxyHandlethat is not assignment-compatible with the localcexcelrwtype token. - .NET throws
System.InvalidCastExceptionwith the canonical message Unable to cast transparent proxy to type 'cexcelrw'.
The most common reasons the binding is broken on a field PC are:
-
Microsoft Office (any version) was installed or upgraded after WinCC, and the Click-to-Run or MSI installer replaced the in-box
DocumentFormat.OpenXmlwith a different 2.x version (most often 2.5, 2.6, 2.7, or 2.9), or with a 64-bit-only build that cannot load in the 32-bit Configuration Studio. -
Windows Update silently replaced the assembly in the GAC under
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\DocumentFormat.OpenXml\. -
A second Siemens tool (TIA Portal V13/V14, SIMATIC Energy Manager, S7-PLCSIM, Process Diagnostics) placed a newer
DocumentFormat.OpenXml.dllin a directory that wins the assembly resolution race. - A previous Open XML SDK repair or uninstall left the GAC entry in a partially registered state where the strong-name signature is invalid.
- Manual deletion of the SDK folder by an admin cleanup script, which removes files but not the GAC entries (or vice versa), creating version skew.
The fix is not to re-cast the proxy, clear the .NET fusion cache, or modify the WinCC project. The fix is to restore the exact Open XML SDK 2.0 build that WinCC V7.3 was tested against (2.0.5022.0) into both the file system and the Global Assembly Cache.
4. Pre-flight Diagnostic Checks
Perform the following checks before reinstalling. They confirm the diagnosis and surface any Office/64-bit co-cause that would re-break the install minutes after a successful fix.
4.1 Verify the assembly version in the GAC
Open an elevated cmd.exe and list the assembly:
gacutil /l DocumentFormat.OpenXml
Expected: a single entry with version 2.0.5022.0 and culture neutral. If a 2.5.x / 2.6.x / 2.7.x / 2.9.x or higher version is listed, you have a hard version conflict — this is the most likely cause of the cast failure. If multiple versions are listed side-by-side, that is also a fault condition: the binder can resolve to any of them at random.
If gacutil is not on the PATH (typical for client Windows installations), use PowerShell 5.1:
[System.Reflection.Assembly]::LoadWithPartialName("DocumentFormat.OpenXml") | Select-Object FullName
Note the bound version; cross-check it against the expected 2.0.5022.0__31bf3856ad364e35 strong name.
4.2 Inspect the registry hive
reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Open XML SDK" /s
Expected: a sub-key 2.0 with a string value InstallPath pointing to C:\Program Files (x86)\Open XML SDK\V2.0\. A missing key or a wrong path is a clear sign that the SDK is not installed in the WinCC-expected location.
4.3 Check the Office architecture
reg query "HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" /v Platform
reg query "HKLM\SOFTWARE\Microsoft\Office\16.0\Outlook" /v Bitness
If Platform resolves to x64 (or Bitness is x64), 64-bit Office is installed. WinCC V7.3 Configuration Studio is a 32-bit process and will not reliably interop with 64-bit Office; this is a co-root-cause that must be remediated before the SDK reinstall is durable.
4.4 Capture the .NET binding failure in the event log and Fusion log
Reproduce the import/export action once while the Fusion Log Viewer (fuslogvw.exe) is enabled to "Log all binds to disk" in a custom path. Filter the produced HTML traces for cexcelrw and DocumentFormat.OpenXml. The binder trace will name the exact .dll path that was probed and the failure HRESULT (typically FILE_NOT_FOUND or 0x80131040 LOAD_ASSEMBLY_NOT_FOUND). The path named in the failing trace is the version that the Configuration Studio is trying to bind — if it is anything other than 2.0.5022.0__31bf3856ad364e35, the diagnosis is confirmed.
Also check Event Viewer → Windows Logs → Application for .NET Runtime source error events referencing cexcelrw; these are typically logged with Event ID 1023 or 1026 and contain the assembly version that failed to load.
5. Resolution Procedure: Manual Reinstallation of Open XML SDK 2.0
The fix is a manual reinstall of the exact MSI that ships on the WinCC V7.3 installation medium. Do not download a newer Open XML SDK from the web unless the medium is unavailable — see Section 8 for the only acceptable exception.
- Local Administrator rights on the engineering station.
- WinCC V7.3 installation DVD or mounted ISO at drive
X:. - All
CCConfigStudio.exeinstances closed (also check Task Manager for hungCCConfigStudio.exe *32processes). - WinCC Runtime services may remain running; the MSI updates in-box SDK files only and does not touch the project database.
- Pending Windows Update reboots should be completed first to avoid file-locking conflicts.
5.1 Locate the MSI on the WinCC medium
X:\InstData\OpenXMLSDK\OpenXMLSDKv2.msi
If your medium is the electronic download (HSP, "Siemens Industry Mall" download manager), the same relative path exists under the extracted tree. The MSI is approximately 5 MB and is signed by Microsoft Corporation with timestamp 2012-08-21 or later.
5.2 Uninstall any pre-existing Open XML SDK 2.x
Either via the command line (silent uninstall, requires elevated prompt):
msiexec /x {8B74E64E-7E5D-4D5C-8E27-3F2A6C2B7C8E} /qn /L*V "%TEMP%\OpenXMLSDKv2_uninstall.log"
Or, more reliably and visibly, from Control Panel → Programs and Features: uninstall every entry named "Microsoft Open XML SDK 2.0 for Microsoft Office". Repeat until the list is empty — multiple passes may be required if older 2.0/2.5/2.6/2.7 builds coexist.
5.3 Reinstall from the WinCC media
msiexec /i "X:\InstData\OpenXMLSDK\OpenXMLSDKv2.msi" /qb REINSTALLMODE=vomus /L*V "%TEMP%\OpenXMLSDKv2_install.log"
The REINSTALLMODE=vomus switch forces the installer to replace every file, registry key, and component regardless of the version check, so any corrupted 2.5/2.6/2.7/2.9 binding on disk is overwritten with the tested 2.0.5022.0 build. The MSI log at %TEMP%\OpenXMLSDKv2_install.log must end with Installation completed successfully and a Return Value 3 in the log indicates a fatal MSI error — capture and review.
5.4 Repair the GAC registration
"C:\Program Files (x86)\Open XML SDK\V2.0\bin\InstallUtil.exe" ^
"C:\Program Files (x86)\Open XML SDK\V2.0\lib\DocumentFormat.OpenXml.dll"
If the bin\InstallUtil.exe binary is not present (some media revisions skip it), a reboot is sufficient: msiexec self-registers the assembly in the 32-bit GAC under C:\Windows\Microsoft.NET\assembly\GAC_MSIL\DocumentFormat.OpenXml\2.0.5022.0__31bf3856ad364e35\.
5.5 Re-test the Configuration Studio
Open WinCC Configuration Studio, right-click the Tag Management node, choose Export, and target a small test workbook. The export must complete without the cexcelrw exception and produce a valid .xlsx that opens cleanly in Excel 2010/2013/2016 32-bit without a "file format not recognized" warning.
6. Microsoft Office 32-bit vs 64-bit Implications
A frequent companion fault to the cexcelrw cast error is the presence of a 64-bit Office installation on the engineering station. WinCC V7.3 was qualified against 32-bit Office 2010, 2013, and 2016 only. The 64-bit Office line introduces three concrete problems for the Configuration Studio:
- It ships a different
DocumentFormat.OpenXml(or none at all, depending on the build), so a fresh Office install can remove the SDK that WinCC was relying on. - The Click-to-Run service can re-run the Office installer in the background and silently replace the Open XML SDK on the disk — re-introducing the version conflict minutes after you fixed it.
- 64-bit Office cannot host the 32-bit COM interop that the Configuration Studio's
cexcelrwwrapper expects, so any code path that crosses the Office boundary (for example, exporting with embedded formulas) fails with a secondary COM error.
7. Verification and Regression Test
A successful reinstall must be demonstrated by all of the following checks. Treat the export operation as a black-box smoke test: a successful export proves the entire cexcelrw → DocumentFormat.OpenXml → CCConfigStudio.exe chain is healthy.
- Configuration Studio launches without delay and the Tag Management tree populates within 5 seconds on a 5,000-tag project.
-
Export of a 500-tag project completes in under 10 seconds and produces a valid
.xlsx(verify by opening it in Excel 32-bit — no file format not recognized warning, and the cell values display correctly). - Import of the same workbook (after editing one tag name in Excel) applies the change and logs a successful diff in the Configuration Studio message pane.
-
Process Monitor (procmon) shows
CCConfigStudio.exeloadingC:\Windows\Microsoft.NET\assembly\GAC_MSIL\DocumentFormat.OpenXml\2.0.5022.0__31bf3856ad364e35\DocumentFormat.OpenXml.dlland no other version. -
Event Viewer → .NET Runtime category has no new error events for
DocumentFormat.OpenXmlfor at least 24 hours of normal Configuration Studio use. - Reboot test: reboot the PC, re-open the Configuration Studio, repeat the export — the error must not return.
If any step fails, re-run msiexec /i "X:\InstData\OpenXMLSDK\OpenXMLSDKv2.msi" /qb REINSTALLMODE=vomus and inspect the MSI log at %TEMP%\OpenXMLSDKv2.log for Return Value 3 (fatal error) or Return Value 1603 (file in use).
8. Preventive Hardening and Deployment Best Practices
For engineering workstations and image rollouts where the issue is likely to recur, apply the following controls. The goal is to keep the Open XML SDK 2.0 binding immutable for the lifetime of the WinCC V7.3 installation.
| Action | Reason |
|---|---|
Pin Office architecture to 32-bit in the master image via Config.xml Click-to-Run customization |
Prevents silent Click-to-Run upgrades flipping to 64-bit |
| Disable Windows Update auto-update of the Microsoft Open XML SDK family GUIDs via Group Policy | Prevents in-place version drift to 2.5/2.6/2.7/2.9 |
Deploy OpenXMLSDKv2.msi as a required Application in the MDT/SCCM task sequence, before the WinCC step |
Guarantees version 2.0.5022.0 is present before any Configuration Studio launch |
| Block installation of TIA Portal V14+ on WinCC V7.3 engineering PCs | Newer TIA versions ship Open XML SDK 2.5+ and overwrite the GAC entry |
Document the cexcelrw string in the internal support runbook |
Cuts mean-time-to-repair for this exact error from days to minutes |
| Use a dedicated engineering VM per WinCC major version | Isolates GAC contamination from other tools and other WinCC versions |
Forbid DocumentFormat.OpenXml.dll in any user-writable directory under %PATH%
|
Prevents shadow-copy resolution race conditions |
9. Troubleshooting Matrix: Symptoms and Resolutions
| Symptom in Configuration Studio | Likely Root Cause | Resolution |
|---|---|---|
| Unable to cast transparent proxy to type 'cexcelrw'. | Open XML SDK 2.0 binding corrupted / wrong version in GAC | Reinstall OpenXMLSDKv2.msi with REINSTALLMODE=vomus (Section 5) |
| Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.0.5022.0, ...' | GAC entry for SDK 2.0 missing, only 2.5+ present | Install SDK 2.0 from WinCC medium; uninstall newer SDK first |
| Export hangs for 30+ seconds, then returns a generic COM error 0x80080005 | 64-bit Office is interfering via COM | Uninstall 64-bit Office, install 32-bit Office 2016, re-run SDK reinstall |
Configuration Studio crashes on launch (CCConfigStudio.exe *32 exits within 1 s) |
Conflicting Open XML SDK DLL in WinCC working directory | Search for stray DocumentFormat.OpenXml.dll under %ProgramFiles(x86)%\Siemens\ and remove duplicates |
| Import succeeds but tag names appear as ????? in the editor | Excel file saved by 64-bit Office with a non-ANSI codepage | Re-save the .xlsx from 32-bit Excel 2016 in UTF-8 (Save As → Tools → Web Options → Encoding) |
| Import silently does nothing ("Import" button greys out) | Excel file contains 0 rows of data in the expected Tags sheet | Verify that the workbook has a sheet literally named Tags with row 1 as the header row |
| Event ID 1026, .NET Runtime error, FileNotFoundException: DocumentFormat.OpenXml | WinCC was started before the SDK MSI had finished installing | Reboot the PC, re-launch the Configuration Studio |
10. Alternative Workflows When Reinstallation Fails
If the MSI reinstall does not clear the cast error (rare, but observed when the .NET Framework itself is damaged), use one of the following fallbacks. Each bypasses the Open XML SDK bridge without requiring a project re-build.
10.1 CSV import via the legacy WinCC Explorer
The classic WinCC Explorer still supports CSV import for tags, which does not use the Open XML SDK. Open the project in the Explorer (not Configuration Studio), right-click Tag Management → Import, choose .csv. The CSV schema for V7.3 is:
Name;Type;Length;Address;Comment
Motor_Speed;Int;4;DB100.DBW0;rpm
Valve_Pos;Real;4;DB100.DBD2;percent
Note the German-style semicolon separator is the default for V7.3 running on German/European locale; on en-US locale, the separator is a comma. Adjust the file extension or locale in the Import dialog accordingly.
10.2 Direct editing of the project XML
The Configuration Studio stores tag data under [ProjectPath]\Gracs\TagManagement.xml (WinCC V7.3 schema). This file is the same Office Open XML format (a .xlsx zip with renamed extension). Editing it with Notepad++ inside the zip container and re-validating with the SDK 2.0 build (PowerShell 5.1, see 10.3) is supported. Always back up TagManagement.xml before manual edits.
10.3 PowerShell-driven bulk edit
Add-Type -Path "C:\Program Files (x86)\Open XML SDK\V2.0\lib\DocumentFormat.OpenXml.dll"
$doc = [DocumentFormat.OpenXml.Packaging.SpreadsheetDocument]::Open($path, $true)
$ws = $doc.WorkbookPart.WorksheetParts[0].Worksheet
# iterate rows, modify cell values, save
$doc.Dispose()
The 2.0.5022.0 build is required here; a 2.5+ build will refuse to open the WinCC-generated workbook because of an internal schema mismatch in the shared strings table, surfacing as OpenXmlPackageException: Invalid XML.
11. WinCC Unified Modern Workflow Reference
Projects migrating to WinCC Unified (TIA Portal V17 and newer) get a redesigned import/export path that no longer relies on Open XML SDK 2.0. The HMI Tags editor exposes native Export / Import buttons that consume a structured tag container (XLSX-based, but consumed by a Unified-specific schema), which avoids both the .xlsx dependency on the WinCC-2.0 SDK and the cexcelrw type entirely. For full details, see the Siemens documentation at Export and import of tags (RT Unified) - WinCC Unified.
When planning a migration, capture the same column layout you used in the V7.3 .xlsx template (Name, Datatype, Connection, Address, Comment) — the Unified exporter keeps the same logical structure, so your existing tag workbooks remain a usable reference for naming conventions even after the underlying engine is replaced. If you must keep V7.3 and Unified side-by-side on the same engineering station, isolate the SDK versions in separate Windows user profiles; the GAC is per-machine, not per-user, so a true coexistence requires a virtual machine or a separate physical PC.
For general WinCC V7.3 questions, support entry points, and firmware / service pack downloads, see the Siemens Industry Online Support portal. For the Open XML SDK 2.0 reference and the DocumentFormat.OpenXml API surface, see the Microsoft .NET API browser for DocumentFormat.OpenXml.
12. Frequently Asked Questions
Does this error affect WinCC V7.4 or V7.5 as well?
Yes, any WinCC version that ships the Configuration Studio with the Open XML SDK 2.0 bridge (V7.3 through V7.4 SP1) is exposed. V7.5 onward uses a newer SDK and is not affected. Apply the same Open XML SDK 2.0 reinstall procedure from the appropriate WinCC media.
Can I just download Open XML SDK 2.0 from Microsoft and install it?
You can, but it is not recommended as a first step. The Microsoft web installer sometimes pushes a higher 2.x build that is not bit-for-bit identical to the build WinCC was qualified against. Always prefer the MSI from X:\InstData\OpenXMLSDK\OpenXMLSDKv2.msi on your specific WinCC installation medium. If the medium is unavailable, the Microsoft Open XML SDK 2.0 download is an acceptable substitute — verify the resulting file version is exactly 2.0.5022.0 via PowerShell Get-Item ... | Select-Object VersionInfo before launching the Configuration Studio.
Is a reboot required after the MSI reinstall?
Not strictly, but recommended. The Configuration Studio caches the assembly reference in its AppDomain; closing all instances (and confirming no CCConfigStudio.exe *32 lingers in Task Manager) guarantees the next launch re-binds against the freshly reinstalled SDK.
Will uninstalling 64-bit Office break Excel reports that the runtime HMI uses?
Runtime HMI servers should not have Office installed at all — the HMI faceplates read .xlsx via Open XML SDK without Office. On engineering stations, switch to 32-bit Office 2016 or 2019 and re-test the Excel reports; 32-bit Office is fully script-compatible with the existing VBA and the cexcelrw bridge will resume normal operation.
How do I confirm the install succeeded without launching WinCC?
Run gacutil /l DocumentFormat.OpenXml and confirm version 2.0.5022.0 in the GAC, and check that C:\Program Files (x86)\Open XML SDK\V2.0\lib\DocumentFormat.OpenXml.dll exists with a file version of 2.0.5022.0. A PowerShell [System.Reflection.Assembly]::LoadFile(...).GetName().Version round-trip is a strong pass/fail check that does not require a WinCC license or a running project.