COCO - CAPE-OPEN to CAPE-OPEN simulation environment

Creating a new COFE-in-Excel document

Getting started

To create a new COFE document in Excel, you will need the COFE.xlt Excel template that is located in the COCO installation folder.

One way to create a new document is to simply double-click the COFE.xlt file. Mind that this it not the same as opening the COFE.xlt file from the File menu in Excel (as this will cause the xlt file to be overwritten when choosing Save from the File menu).

To make it easier to start a new file, one can:

When starting a new file or opening an existing file, macros need to be enabled, see macro security.

When using any of the above methods to start a new file, first you will be prompted for a flowsheet document. You can use either a new - empty - flowsheet document, or one that is existing on disk already. If you choose a new document, the document configuration dialog pops up. Here, one should at least load a property package (and assign it to the default stream type) to be able to use thermodynamics inside Excel.

If you choose an existing document, you will be asked for the location of an .fsd file on your computer. If you cancel the action of inserting a document, the Excel file will close, as the macros require a document to be present.

Next, you will be prompted for which examples you would like to be in the document. Select the desired examples and click ok. The examples are a starting point for setting up your own calculations.

The streams and unit operations examples require streams and unit operations to be present in the flowsheet; they are best viewed using an existing flowsheet file on disk to start with.

The Flowsheet document object

The flowsheet document object will be inserted into the Flowsheet page. If you switch to the flowsheet page, the flowsheet document object will automatically be activated. The activation is done inside the Excel application, but in some circumstances (if the fsd file was saved with multiple windows open, or if the COFE application is running and visible) the document may open in the COFE application instead.

If you switch away from the Flowsheet page, the script assumes you may have made changes to the flowsheet configuration, and all COFE dependent formulas will be recalculated.

All VBA code related to flowsheet document maintenance, scaling and activation of the flowsheet object, maintenance of the COFE Excel menu, the start-up wizard, etc, is located in the VBA code for the COFEWorkbook and FlowsheetObject objects. All VBA code is accessible and can be modified by the user to suit his or her needs.

Functionality like updating calculations, resizing, ..., is triggered by activation of flowsheet pages. If you find that your document did not update properly, switching to another page and switching back may resolve the issue.