DIAdem Help

Method: GetCellBlock for Sheet

  • Updated2024-09-12
  • 1 minute(s) read

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])
ObjectSheet
Object with this method
RowLongInteger
Specifies the row of the block origin. The first row has the value 1.
ColumnLongInteger
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:
 1
eDirectionVertical 
Columnwise
 2
eDirectionHorizontal 
Rowwise
oCellBlockCellBlock
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

Log in to get a better experience