Method: GetCellBlock for Sheet
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Methods > Method: GetCellBlock for Sheet
Method: GetCellBlock for Sheet
Reads the worksheet starting at a specified position and returns the channel values the worksheet contains.
Set oCellBlock = Object.GetCellBlock(Row, Column, [Direction])
| Object | Sheet Object with this method | ||||||
| Row | LongInteger Specifies the row of the block origin. The first row has the value 1. | ||||||
| Column | LongInteger Specifies the column of the block origin. The first column has the value 1. | ||||||
| [Direction] | Specifies the reading order. The default value is eDirectionVertical, which means DIAdem reads the worksheet columnwise. Enumeration with the following selection terms:
| ||||||
| oCellBlock | CellBlock Returned object |
The following example reads the values of the worksheet columnwise from the second row of the first column onwards 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