Link Search Menu Expand Document

SSpread.InsertCols Method

Explanation Inserts one or more columns before the specified column.

Inserting columns does not increase the maximum number of columns set in the MaxCols property.
The data that was set in the last column of the spreadsheet will be out of range and lost due to the insertion of the column.
Call format InsertCols(col, numcols)
Return value None
Arguments col Column number immediately before the column insertion position
numcols Number of columns to insert
Exception EXT-1 The argument of InsertCols is invalid
EXT-28 An error occurred in the InsertCols method
Example of use
    Function OnRClicked(e) {
        if (e.Row == 0 && e.Col > 0) {
            var ret = PopupMenu("Add row", "Delete row");
            switch (ret) {
            case 1:
                InsertCols(e.Col, 1);
                break;
            case 2:
                DeleteCols(e.Col, 1);
                break;
            }
        }
    }
    
Related item MaxCols property
DeleteCols, InsertRows methods