DIAdem Help

Property: MaxPosition for Sheet

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

Property: MaxPosition for Sheet

Specifies within the worksheet the position of the cell that contains the last value.

Set oCellPosition = Object.MaxPosition
ObjectSheet
Object with this property
oCellPositionCellPosition
Returned object

The following example reads in the values of the worksheet columnwise from the second row 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