The Cogent DataHub program can send and receive the data contained in an entire range of an Excel spreadsheet. This data is treated as an array, a two-dimensional range of cells as rows and columns. The array can be as big as necessary (within point size limits), or as small as a single cell—at least one row and one column.
Excel transmits array data as a tab-and-newline delimited text string of values. Each value in a row is separated by a tab, and each row is separated by a newline character. The string does not contain any information concerning the source range of the array within the spreadsheet.
There are two methods of transmitting a range, or array data, from Excel to the DataHub instance. These exactly match the mechanisms used for individual point data: DDEPoke and DDEAdvise.
A DDEPoke command can be issued by Excel to send data to the DataHub instance
based on a trigger within Excel. For this to work, the DataHub instance needs to be
configured to act as a DDE server and have
registered at least one service name. An Excel macro can then issue a DDEPoke to
that service, along with a DataHub data domain name (the DDE topic), a point name
(the DDE item) and a value. If the value is of type Range
then Excel will automatically format the value as a tab-and-newline separated
string.
Example: See the definition of the PutData function in
the Excel macro coding
examples below.
When sending data from Excel to the DataHub instance using a DDE advise loop, Excel acts as the DDE server and DataHub instance acts as the client. To create the advise loop:
Open the Cogent DataHub Properties Window (by right-clicking on the DataHub icon in the Windows system tray and selecting ).
Click the DDE button.
Make sure the box is checked.
Click the button. This opens the DDE Item Definition window.

Type in the following information:
Connection Name Choose a name to identify this connection. It must be unique among all DDE connections.
Service
Type in Excel (case is not
important).
Topic
Type the name of your worksheet file, including the
.xls extension, like this:
.my_filename.xls
Item Names
These create a mapping between Excel cells and ranges, and
DataHub point names. You may specify a single cell in
r
format, a range of cells in
1c1r
format, a cell name, or a range name as the DDE Item name.
For example:1c1:r2c2
r2c5
| - accesses the cell E2
(second row, fifth column) |
r3c3:r5c9
| - accesses the range
C3:I5 |
MyRange
| - accesses the cell or range that is named
MyRange |
Click the button. The fields DDE Item, Point Name and Data Domain should automatically fill in with some values.
![]() | |
Check the names in the Point Name and Data Domain columns. If either of them is not what you need, double-click it to select it, and change it. |
Click to close the DDE Item Definition window. The fields DDE Connection Name and Status in the Properties Window should now be filled in as well.
Click to close the Properties Window.
Enter some values in the range of the spreadsheet you have defined. You should see the array in the Data Browser change accordingly.