Method: Add for DirectCellChannels
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Methods > Method: Add for DirectCellChannels
Method: Add for DirectCellChannels
Adds an object to the DirectCellChannels collection of a CellBlock and returns a DirectAccessChannel object.
Set oDirectAccessChannel = Object.Add(Name, [DataType])
| Object | DirectCellChannels Object with this method | ||||||||||||||||||
| Name | String Specifies the name of the channel. | ||||||||||||||||||
| [DataType] | Specifies the data type of the channel. If you do not specify the data type, the first cell of the channel automatically determines the data type. Enumeration with the following selection terms:
| ||||||||||||||||||
| oDirectAccessChannel | DirectAccessChannel Returned object |
| Note The channel name must be unique. |
The following example reads in the values of the worksheet columnwise from the second row of the first column and saves the values in channels of the first channel group:
Dim oCurrSheet Set oCurrSheet = Workbook.Sheets(1) Dim oCellBlock Set oCellBlock = oCurrSheet.GetCellBlock(2,1) Dim i, Name, oNewChannel For i = 1 to oCurrSheet.MaxPosition.Column Name = oCurrSheet.GetCellValue(1,i) Set oNewChannel = oCellBlock.Channels.Add(Name) Call Root.ChannelGroups(1).Channels.AddDirectAccessChannel(oNewChannel) Next