How OPC Excel Configurations Persist When the Workbook Is Closed and Reopened

OPC Expert saves OPC configuration and query definitions within the Excel workbook file itself. When the workbook is saved and later reopened, the OPC connections, subscribed items, and historical query parameters are restored. The workbook stores the query, not the data, so historical results are retrieved fresh from the archive on the next recalculation, and real-time subscriptions are re-established when the workbook opens and OPC Expert is running.

What Is Stored in the Workbook

The Excel workbook retains the RTD formulas that reference specific OPC items, the query definitions used for historical data retrieval, and any time parameters defined using Excel formulas. It does not store the actual data values from previous sessions as static records; the data is always retrieved live from the OPC server or archive. This design means the workbook remains compact and always reflects current data when opened, rather than accumulating stale records from prior sessions.

What Is Required When Reopening the Workbook

When the workbook is reopened, OPC Expert must be running on the same machine for real-time data to resume. The RTD connection between Excel and OPC Expert is re-established automatically when both applications are open. For historical data, OPC Expert’s archive service must be running, either as a Windows service or as an active application, for queries to execute successfully. The webinar demonstrates this explicitly: after closing both Excel and the OPC Expert interface entirely, only the Windows services remain active. When Excel is reopened, the historical query immediately retrieves current data from the archive that continued running as a service in the background.

Using Dynamic Time Parameters for Persistent Reports

A well-designed OPC Excel report uses dynamic time parameters rather than hardcoded dates. By defining the start and end time of a historical query using Excel’s NOW() function and a relative time offset formula, the query always retrieves the relevant period regardless of when the file is opened. This means a report configured to show the last hour, last shift, or last day will return the correct data on every open without any manual adjustment. The webinar presenter demonstrates this pattern with a one-minute rolling historical view that recalculates correctly every time the workbook is refreshed.

Relevant Tools

OPC to Excel is the OPC Expert module that embeds OPC configuration and historical queries into the Excel workbook. It handles the reconnection process when the workbook is reopened and OPC Expert is running, restoring live data subscriptions and executing historical queries automatically.

Archive OPC Data is the OPC Expert module that captures and stores historical data as a Windows service, ensuring that the archive is populated continuously and available for Excel queries regardless of whether the workbook or the OPC Expert interface is open.

Summary

OPC configuration and query definitions are stored inside the Excel workbook and restored each time the file is opened. Real-time subscriptions resume when both the workbook and OPC Expert are open. Historical queries retrieve fresh data from the archive, which runs as a Windows service independently of Excel. Using dynamic time formulas in historical queries ensures reports remain current on every open without manual updates.