2.42.4 Cols


Description

The Cols property is an integer value that holds the number of columns in the worksheet.

Syntax

VB: Property Get/Let Cols As Integer
C++: int Cols
C#: int Cols

Parameters

Remark

Examples

VBA

Private Sub AddColumnsToWorksheet(sheetName As String, numCols As Integer)
    Dim app As Origin.ApplicationSI
    Set app = New Origin.ApplicationSI
 
    Dim wks As Origin.Worksheet
    Set wks = app.FindWorksheet(sheetName)
    If wks Is Nothing Then
        MsgBox ("Failed to find worksheet")
        Exit Sub
    End If

    wks.Cols = wks.Cols + numCols
End Sub

C#

using Origin; // allow using Column, Worksheet, etc. without having to write Origin.Column

static void AddColumnsToWorksheet(string strSheetName, int nCols)
{
    ApplicationSI app = new Origin.ApplicationSI();

    Worksheet wks = app.FindWorksheet(strSheetName);
    if (wks == null)
    {
        Console.WriteLine("Failed to find worksheet");
        return;
    }

    wks.Cols += nCols;
}


Version Information

8.0SR2

See Also

OriginCOM:Worksheet-Rows