IMDTouchKnowledge BaseShop main store

Troubleshooting

Fixing a WinCC Flexible 2007 Script Editor SecurityException

HMI and touchscreens Published 4 min read By IMDTouch engineering team

Short answer

The SecurityException in the WinCC flexible 2007 script editor comes from a denied registry read while the editor builds its type-library lookup, not from the script itself. Match the failure signature, confirm the released Windows combination, then have an administrator inspect the denied registry access. Reformatting only clears it for six or seven days.

On this page
  1. Read the failure signature first
  2. Matching the two reported 2007 cases
  3. Check the released operating-system combination
  4. Separate the second fault
  5. Investigate the registry denial without formatting
  6. Verification criteria
  7. Questions asked

When the WinCC flexible 2007 Engineering System script editor throws System.Security.SecurityException with the message Requested registry access is not allowed, the cause is a denied registry read on the engineering workstation, not your script. Formatting and reinstalling Windows clears it for only six or seven days in the reported case, so treat that as an inconclusive workaround. Work through the checks below in order.

Read the failure signature first #

The report that matters here contains three parts that must all be present:

  • Exception type System.Security.SecurityException with the message about registry access not being allowed
  • The .NET method Microsoft.Win32.RegistryKey.OpenSubKey in the stack
  • The WinCC flexible scripting methods FillTlbsHashtableFormRegistryKeyCLSID(), FillTypeLibsHashTable(), GetTypeLibGuidFromProgId() and Init_ProgId() above it

Together these show that a background thread of the script editor failed while reading registry data that maps a programmatic identifier to a type library, during a CreateObject entry. The report does not name the denied key, and it does not by itself tell you whether permissions, group policy, security software or installation damage caused the denial.

A different exception is a different fault. Do not route it into this investigation.

Matching the two reported 2007 cases #

The rule: classify a report as this fault only when the exception type and the registry/type-library stack path both match. The inputs are the exact strings the error reports print.

  • Case 1: WinCC flexible 2007 Advanced; K 1.02 Hotfix 4; K 1.2.0 HF 4 (1.05.03) on Windows XP Professional Service Pack 3, build 5.1.2600.196608. The stack shows OpenSubKey under the scripting reflection methods. Result: this fault, on a combination the vendor never released for SP3.
  • Case 2: WinCC flexible 2007 Advanced; V 1.02; V 1.2.0.0 (1.55.01) on Windows XP Professional Service Pack 2, build 5.1.2600.131072. The stack shows the same OpenSubKey path. Result: this fault again, so the SP3 mismatch is not the only demonstrated cause.

The decision: work both cases as a registry-permission investigation on the workstation, and correct the released-operating-system mismatch in the first case before drawing further conclusions from it.

Check the released operating-system combination #

The delivery release for WinCC flexible 2007 lists the Windows versions the product was released for, and Windows XP Professional SP3 is not among them; the same document names Windows XP Embedded releases for specific SIMATIC panel PCs. Run the vendor's compatibility documentation, not a forum reply, against your installed combination: product version, hotfix level, Windows edition and service pack. The same discipline applies to any engineering tool and OS pairing; the unsupported-combination failure mode is the same one behind the 840D sl HMI package refusing to install on 64-bit Windows 7.

Because the SP2 case reproduced the identical exception, an unsupported service pack cannot be the whole story. Fix the released combination first where it is wrong, then keep investigating registry access.

Separate the second fault #

A second report in the same discussion is not this fault. WinCC flexible 2008 Advanced V 1.3.0.0 on Windows Vista Ultimate failed with Siemens.Simatic.Hmi.Utah.SystemDiagnosis.SystemDiagnosisException, message Reading version information failed, thrown from ReadVersionInformation() during application initialization. That is a startup version-check failure, and it appeared immediately after Windows updates were installed on that machine. Classify it separately and look at what the updates changed before the failure.

Investigate the registry denial without formatting #

Follow these steps in order:

  1. Record the full product version, hotfix level, Windows edition and service pack before changing anything on the workstation.
  2. Confirm the released software and operating-system combination, and correct an unsupported one before interpreting any further result.
  3. Have an authorized administrator inspect, with approved Windows diagnostics, the access controls and policies affecting the registry lookup at the moment of failure. Microsoft's own guidance for access denied while editing a registry value starts from the key's ownership and permissions, which is exactly the layer to inspect here.
  4. Compare the configuration, installed updates, security software and applied policies between the clean post-install state and the point where the exception returns, typically six or seven days later. Whatever changed in that window is your suspect.
  5. Retest the same CreateObject entry in the script editor. Resolution without the security exception is the pass condition.

Do not grant broad registry permissions to get past the error. Narrow the denied key down first; widening permissions can mask a policy that something on the network is actively reapplying.

Verification criteria #

A valid resolution satisfies all three checks: the software and operating-system combination is a released one, the script editor opens and resolves the same programmatic identifier, and no further registry-access report is generated. Keep the before-and-after version data and error reports so you can correlate any recurrence with later changes to policies, updates or security software on the workstation.

If the workstation itself is aging and the engineering tool keeps failing on it, the fallback is not another reformat: moving the engineering seat onto current industrial panel PCs or a supported panel PC puts the runtime and the engineering tool on hardware with a supported operating system in the first place.

Questions asked

Why does the WinCC flexible 2007 script editor fail on CreateObject?

The captured stack shows a denied registry read through RegistryKey.OpenSubKey while the editor builds its CLSID and type-library table for the programmatic identifier. The error report names the code path but not the denied registry key, so the cause is a registry permission or policy problem on the workstation, not a syntax error in your script.

Is WinCC flexible 2007 released for Windows XP Professional SP3?

No. The delivery release documentation for WinCC flexible 2007 does not include Windows XP Professional SP3, and a Siemens support reply in the original case pointed this out. The same SecurityException still appeared on an XP SP2 installation, so an unsupported service pack is one condition to correct, but not the only demonstrated cause. Verify your exact product and hotfix level against the vendor compatibility documentation.

Will reinstalling Windows fix the registry access error?

Only briefly. In the reported case a fresh Windows XP installation cleared the exception, but it came back after six or seven days of normal use. Something the workstation picks up after reinstall, such as a policy push, security software or an update, restores the denial. Capture the configuration before and after recurrence instead of formatting again.

Keep reading

  • Troubleshooting

    Why a WinCC Flexible Excel Report Script Overwrites Its Data

    The script writes Date(), Time() and a SmartTags value into fixed cells A2, B2 and B4, then saves the same workbook, so every trigger replaces the previous report instead of appending a row. A missing or stale report traces to one of three separate failures: tag acquisition, Excel COM automation or file access on the runtime PC.

    HMI and touchscreens

  • Troubleshooting

    Why WinCC flexible MPI transfer closes its waiting window

    The waiting window closes because the Loader's MPI transfer channel cannot open the CP5611; a channel that initializes, as Ethernet does here, keeps the window open. Runtime SP3 is the released service pack for 64-bit Windows 7, so the project, the installation and the user groups are cleared. The fault is the adapter's 64-bit communication driver or the access point that should bind MPI to the CP5611.

    HMI and touchscreens

  • Troubleshooting

    Fixing OPC DA Subscription Callback Faults in a WinCC HMI Client

    The fault is on the reverse COM path: the WinCC OPC server must call back into the client to deliver subscribed values, and that callback is denied when the client service and the server run under different Windows accounts. Set the client service's Log On identity to the account running WinCC, restart it, and re-create the connection; that single change cleared the fault in the documented case.

    HMI and touchscreens