Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

XL.CopyRow

Copies cells from one row to another row.

Component Version macOS Windows Linux Server iOS SDK
XL 6.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.CopyRow"; bookRef1; bookRef2; sheetIndex1; sheetIndex2; SourceRow; DestRow { ; Options } )   More

Parameters

Parameter Description Example Flags
bookRef1 The reference to the source workbook. Please use XL.LoadBook to load a file. $ref
bookRef2 The reference to the destination workbook. Please use XL.LoadBook to load a file. $ref
sheetIndex1 The source index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. 0
sheetIndex2 The destination index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. 0
SourceRow The source row index. $srow
DestRow The destination row index. $drow
Options Which items to skip when copying content. "" Optional

Result

Returns OK or error.

Description

Copies cells from one row to another row.
Source and destination can be in different sheets/books.
This copies most properties and all cells.
If something is missing, please let us know.

OptionDescription.
SkipPicturesDon't copy pictures.
SkipMergesDon't copy merged cells.
SkipNamedRangesDon't copy named ranges.
SkipPrintAreaDon't copy print area.
SkipPrintRepeatDon't copy print repeat
SkipPrintFitDon't copy print fit.
SkipHorPageBreakDon't copy horizontal page breaks.
SkipCommentsDon't copy cell comments.
SkipFormatsDon't copy formats.
SkipRowHiddenDon't copy hidden rows.
SkipColHiddenDon't copy hidden columns.

Examples

Copy row:

# load one from container
Set Variable [$bookRef; Value:MBS( "XL.LoadBook"; XL::ExcelFile)]
# load one from file
Set Variable [$bookRef2; Value:MBS( "XL.LoadBook"; "/Users/cs/Desktop/Format2.xls")]
# copy a row from first sheet. Source row 2 to dest row 10.
Set Variable [$r; Value:MBS( "XL.CopyRow"; $bookRef2; $bookRef; 0; 0; 2; 10 )]
#Save to container and cleanup
Set Field [XL::OutputFile; MBS("XL.Save"; $bookRef; "test.xls")]
Set Variable [$r; Value:MBS( "XL.Book.Release"; $bookRef)]
Set Variable [$r; Value:MBS( "XL.Book.Release"; $bookRef2)]
Set Field [XL::Result; $r]

See also

Release notes

Blog Entries

This function checks for a license.

Created 7th December 2016, last changed 2nd April 2021


XL.CopyContent - XL.CopySheet