Open Excel in WinCC V7.4 Runtime: OWC, ProgramExecute, DataMonitor
Overview
WinCC V7.4 (and the V7.4 SP1 branch) does not ship a native "Excel viewer" object inside the Graphics Designer. To render or edit a Microsoft Excel worksheet inside a WinCC picture window, or to launch Excel as a side process for a WinCC button, you must select one of three well-supported integration paths:
- OWC Spreadsheet 11.0 ActiveX — embeds an Excel-compatible sheet directly in the PDL. Requires the Microsoft "Office 2003 Add-in: Office Web Components" redistributable on the Runtime PC.
- ProgramExecute() C-script — launches the locally installed Excel.exe in a separate window and optionally passes a workbook path. The simplest method, but the workbook floats outside the WinCC picture.
- WinCC DataMonitor "Excel Workbooks" — server-side evaluation of archived tags with an Excel template (.xlsx) that is published through the DataMonitor web client. Used for read-only reports, not in-picture editing.
WinCC V7.4 specifically supports 32-bit ActiveX components; on a 64-bit WinCC Runtime you must still install the 32-bit OWC redistributable because the WinCC process loads controls into the 32-bit surrogate.
Prerequisites
| Component | Method 1 OWC | Method 2 ProgramExecute | Method 3 DataMonitor |
|---|---|---|---|
| WinCC V7.4 / V7.4 SP1 installed | Required | Required | Required |
| WinCC Basic Options V7.4 SP1 (DataMonitor server license) | No | No | Required |
| Microsoft Excel 2007 or later on the RT PC | No (OWC runs standalone) | Required (the launched app) | Required on the client that opens the .xlsx |
| Microsoft Office 2003 Add-in: Office Web Components | Required | No | No |
| Administrator rights on RT PC for one-time install | Yes | Yes | Yes |
| Network share accessible from RT user account | Optional | Required if opening remote files | Required (DataMonitor web access) |
Verify the installed WinCC build with the WinCC Information System under "Installed software" or with the file RTComputerName.log in the WinCC project diagnostic folder. The build must read 7.4.0.x or 7.4.1.x; OWC registration steps below are written against 7.4.0.3 and confirmed against 7.4.1.1.
Method 1 — OWC Spreadsheet 11.0 ActiveX in Graphics Designer
This method renders an interactive spreadsheet inside a WinCC picture. Operators can type values, run cell formulas, and the changes are stored in a local .xls file you point to at design time.
Step 1 — Install OWC on the Engineering and Runtime PCs
- Download "Office 2003 Add-in: Office Web Components" from the official Microsoft Download Center (Office 2003 Add-in: Office Web Components).
- Run
OWC11.exewith administrator rights; accept the EULA. - Confirm registration by opening
regeditand verifying the keyHKEY_CLASSES_ROOT\OWC11.Spreadsheet.11\CLSIDexists. - On a 64-bit OS, do not copy the DLLs to
SysWOW64manually; the OWC installer handles the WOW redirection.
Step 2 — Insert the Control into a PDL
- Open the WinCC Explorer and launch Graphics Designer.
- Open the target
.pdlfile. - From the menu Object Palette → Controls → ActiveX, right-click and select Add/Remove.
- Locate "OWC Spreadsheet 11.0" in the list of registered ActiveX controls and tick the checkbox. Click OK.
- Drag the new "OWC Spreadsheet 11.0" icon onto the picture and size it to the target grid area.
- Right-click the placed object → Properties → Control Properties. In the General tab, set DataSource to the path of the workbook, for example
C:\WinCC_Project\Data\ProcessMatrix.xls. - Switch the Appearance tab to disable toolbars and row/column headers if you want a clean panel look.
Step 3 — Drive the Control from VBScript (Optional)
Most V7.4 projects still use C-scripts; both languages are supported. Example VBS that writes a WinCC tag value into cell B2 and reads cell C2 back into a tag:
' VBS on a button "Update Matrix"
Dim sSheet
Set sSheet = ScreenItems("OWC_SPREAD1").Object
' Write from WinCC tag to Excel cell B2
sSheet.Cells(2, 2).Value = SmartTags("Process_Temperature")
' Read Excel cell C2 into WinCC tag
SmartTags("Process_Setpoint") = sSheet.Cells(2, 3).Value
' Force a save back to the DataSource file
sSheet.ActiveWorkbook.Save
The same pattern in a C-action (Global Script) uses the interface pointer returned by GetObject on the object member of SSMOpen.
Step 4 — Save, Compile, Activate
- Save the PDL.
- In WinCC Explorer, click Computer → Properties → Graphics Runtime and confirm the picture is in the start screen list.
- Right-click the computer and select Activate to start RT and verify the embedded spreadsheet renders.
Method 2 — ProgramExecute() to Launch External Excel
This is the most reliable method on modern Windows because it does not depend on deprecated OWC components. The workbook opens in a normal Excel window. To keep the experience tied to the HMI, embed the launch button in a WinCC picture and pass the workbook path as a parameter.
Step 1 — Configure the C-Action
- In Graphics Designer, place a button on the PDL.
- Right-click the button → Properties → Events → Mouse → Click.
- Set the action type to C-action and enter the code below.
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)
{
// Launch Excel with a fixed workbook path
ProgramExecute("C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE \"C:\\WinCC_Project\\Data\\ProcessMatrix.xlsx\"");
}
For dynamic paths stored in an internal tag, build the string at runtime:
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)
{
char szCmd[512];
char* szPath = NULL;
// Read the path from an internal WinCC tag
szPath = GetTagChar("@ExcelFilePath");
if (szPath == NULL || strlen(szPath) == 0)
{
// Fall back to the default
sprintf(szCmd, "excel.exe \"C:\\WinCC_Project\\Data\\ProcessMatrix.xlsx\"");
}
else
{
sprintf(szCmd, "excel.exe \"%s\"", szPath);
}
ProgramExecute(szCmd);
}
Step 2 — Hide Excel Behind the Runtime
Many operators want Excel to appear in the same screen as WinCC. Use a Windows shortcut that starts Excel maximized, or wrap the call in a VBS that sets the window state:
Dim wsh
Set wsh = CreateObject("WScript.Shell")
wsh.Run """C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE"" ""C:\WinCC_Project\Data\ProcessMatrix.xlsx""", 3, False
wsh.AppActivate "Microsoft Excel"
Step 3 — Verify File Association and UAC
On Windows 10/11 the WinCC Runtime service runs as a non-interactive user. If the workbook lives under Program Files or Windows, the process may be virtualized. Move all Excel templates to a folder the Runtime user can write, for example C:\WinCC_Project\Data\, and grant Modify rights to the operator group.
Method 3 — WinCC DataMonitor Excel Workbooks
The DataMonitor option (part of WinCC Basic Options V7.4 SP1) ships a server-side reporting engine that fills a Microsoft Excel template with archived tag values on demand. Operators open the report from the DataMonitor web client; the workbook is generated on the WinCC server and downloaded to the browser. This is the only method that is officially supported for production reports on V7.4.
Step 1 — Install DataMonitor
- Insert the WinCC V7.4 SP1 product DVD.
- Run setup, choose Custom Installation, tick DataMonitor Server on the WinCC server and DataMonitor Client on each client PC.
- Activate the license: WinCC Explorer → Computer → Properties → DataMonitor → enter the license key.
Step 2 — Configure an Excel Workbook Template
- On the DataMonitor server, open the start page
http://<server>/DataMonitor/and log in. - Click Reports → Excel Workbooks.
- Select the target archive (for example the "ProcessValues" Tag Logging archive).
- Design a workbook with placeholders for each tag. Placeholders use the syntax
<Tagname:TimeFilter:Aggregation>, for example<Process_Temperature:LastHour:Average>. - Save the template under
\<server>\WinCCProjects\<project>\DataMonitor\ExcelReports\.
Step 3 — Trigger the Report from a WinCC Picture
- Add a button with the event action Open Internet Explorer or use the WinCC function
OpenWebPage("http://<server>/DataMonitor/Reports/ExcelWorkbooks.aspx"). - Authenticate the operator through the DataMonitor user administration; use the WinCC logon tag
@CurrentUserif you integrate with the WinCC user system. - The generated
.xlsxopens in the operator's default browser session; it can be saved locally or printed.
For TIA Portal projects the equivalent feature is documented at Excel workbooks (RT Professional) - WinCC. The TIA Portal Excel workbook component requires the DataMonitor client and uses the same server-side template engine as V7.4.
Method 4 — OPC Connection to Excel (Read / Write Live Tags)
For projects that need to push live tag values into an Excel sheet without archiving, the Siemens "Excel Workbook Wizard" ships with the SIMATIC NET OPC suite. The wizard installs a local OPC DA server on the RT PC; Excel uses a VBA macro or the in-built "OPC DataHub" add-in to read the tags.
- Install SIMATIC NET on the RT PC and start the OPC Scout.
- Add the WinCC server as an OPC DA source.
- Run the Excel Workbook Wizard and bind the OPC items to named ranges in a workbook.
- Open the workbook in Excel; values refresh at the configured update rate (default 1 s, minimum 100 ms).
This is heavier than the other three methods and is recommended only when operators keep Excel open as a parallel tool. Reference the SIMATIC NET manual for the exact OPC DA server name and CLSID.
Method Comparison
| Criterion | OWC Spreadsheet 11.0 | ProgramExecute() | DataMonitor Excel Workbooks | OPC to Excel |
|---|---|---|---|---|
| Embedded in WinCC picture | Yes | No (separate window) | No (browser) | No (separate window) |
| Operator can edit cells | Yes | Yes | No (read-only output) | Yes (with VBA writeback) |
| Live tag binding | Through VBS / C only | No | Through archive query | Native OPC DA |
| Requires Excel installed | No | Yes | Only on viewing client | Yes |
| Microsoft support status | Retired 2006 | Current | Current | Current |
| Network / multi-client | Local only | Local only | Web-based, multi-client | Local or networked |
| Recommended use | Legacy picture grids | Operator recipe edits | Shift / daily reports | Engineering dashboards |
Verification and Commissioning Checks
-
Picture compile: in Graphics Designer run File → Check Consistency; a missing OWC reference raises error
0x80040154"Class not registered". -
RT activation: confirm the GSC Runtime log
GSCC.logshows no "ActiveX load failed" entries for the spreadsheet object. - File access: from the RT PC, open the workbook path in Windows Explorer using the same user that runs the WinCC Runtime service. Read/write must succeed without a credential prompt.
- Tag roundtrip: execute a VBS that writes a known value to a cell, then read the same cell back and compare; a delta of zero confirms the object model is wired.
-
ProgramExecute test: from a button click, confirm the Excel window appears within 2 s on a typical RT PC; if the process does not appear, inspect
WinCC_RT_<computer>_<date>.logforCreateProcess failed. -
DataMonitor test: from a client browser, navigate to the workbook URL, click Generate Report, and confirm an
.xlsxdownloads. Verify the placeholders are replaced with numeric values, not the literal placeholder text.
Troubleshooting Matrix
| Symptom | Likely root cause | Fix |
|---|---|---|
| OWC control missing from the ActiveX list | OWC 11 redistributable not installed, or 32-bit / 64-bit mismatch | Reinstall the 32-bit OWC 11 package; reboot; reopen Graphics Designer |
Picture shows a red X with error 0x80040154
|
Class not registered on the Runtime PC | Register owc11.dll with regsvr32 owc11.dll from an elevated command prompt |
| ProgramExecute opens Excel in the background | WinCC service session cannot bring a window to the foreground | Configure WinCC Runtime to start as a Windows application, not a service, or use the WScript.Shell AppActivate pattern |
DataMonitor workbook shows literal <Tagname> placeholders |
Tag not in the connected archive, or the placeholder syntax is wrong | Confirm the tag is in Tag Logging; check the placeholder format <Tagname:TimeFilter:Aggregation> against the wizard help |
| Excel workbooks page returns HTTP 401 | DataMonitor user not authorized, or WinCC user administration not bridged | Add the operator group in DataMonitor Configuration → User Administration; enable Windows authentication on the IIS site |
| Live OPC values in Excel freeze after a few minutes | OPC DA subscription timeout on the client | Increase the keep-alive time in SIMATIC NET; reduce the update rate to ≥ 1 s |
| Operator cannot save edits from OWC grid | Workbook file is marked read-only, or stored in Program Files
|
Move the file to C:\WinCC_Project\Data and clear the read-only attribute |
Security and Lifecycle Notes
- Office Web Components were retired by Microsoft in 2006 and are not patched. They are blocked by default in AppLocker on hardened Windows 10/11 images. Do not deploy OWC on systems that must comply with IEC 62443 patching SL-2 or higher.
- DataMonitor publishes the workbook generator through IIS. The default installation uses HTTP; switch to HTTPS and configure a server certificate before commissioning on a plant network.
- ProgramExecute() runs the launched process with the same token as the WinCC Runtime. If the Runtime runs as
LocalSystem, Excel starts with system privileges; switch the WinCC service logon to a dedicated operator account to limit blast radius. - Always store Excel templates on a partition with a documented backup policy; do not co-locate the templates on the same volume as the WinCC archive to keep archive I/O predictable.
Selecting the Right Method
Use the decision flow below for greenfield V7.4 work:
- Need an editable grid in the picture? → OWC 11 only if the customer accepts the retired-component risk; otherwise use ProgramExecute() and a docked Excel window.
-
Need shift / daily / batch reports? → DataMonitor Excel Workbooks, with templates stored under the project
DataMonitorfolder. - Need live tag values in a spreadsheet maintained by engineering? → SIMATIC NET OPC DA to Excel with the Workbook Wizard.
-
Need a one-click recipe editor for a few cells? → ProgramExecute() with a pre-filled
.xlsxtemplate is the lowest-friction option.
FAQ
Can I embed Excel directly in a WinCC V7.4 picture without installing Office?
Yes, using the Microsoft "Office 2003 Add-in: Office Web Components" (OWC Spreadsheet 11.0) ActiveX control. Install the redistributable on both engineering and Runtime PCs, then insert the control from the Graphics Designer ActiveX palette. Note that OWC was retired by Microsoft in 2006 and is not patched.
Which WinCC function opens an external Excel file from a button?
Use the C-script function ProgramExecute("excel.exe \"C:\\path\\file.xlsx\"") on the button's Click event. Pass the path dynamically by reading an internal WinCC tag with GetTagChar and assembling the command string with sprintf.
Does the WinCC DataMonitor option support Excel workbook reports?
Yes. DataMonitor V7.4 SP1 ships the "Excel Workbooks" feature, which fills an Excel template (.xlsx) with archived tag values. Open the report from the DataMonitor web client; the workbook is generated on the server and downloaded to the browser. Installation is documented in the WinCC V7.4 SP1 DataMonitor manual.
Why is the OWC Spreadsheet 11.0 control missing from the ActiveX list?
The 32-bit OWC 11 redistributable is not installed on the engineering PC, or a 64-bit / 32-bit mismatch exists. Reinstall the OWC 11 package from the official Microsoft Download Center, reboot, and reopen Graphics Designer. The COM class is registered under HKEY_CLASSES_ROOT\OWC11.Spreadsheet.11\CLSID.
How do I bind live WinCC tags to cells in Excel?
Use the SIMATIC NET OPC DA server combined with the Excel Workbook Wizard. The wizard binds OPC items to named ranges in the workbook; values refresh at the configured update rate (default 1 s, minimum 100 ms). This is the only method that delivers continuous live values without an archive query.