Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Copies a sheet to another book.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XL | 6.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
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 | |
sheetIndex | The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. |
0 | |
Options | Which items to skip when copying content. | "" | Optional |
Returns OK or error.
Option | Description. |
SkipPictures | Don't copy pictures. |
SkipMerges | Don't copy merged cells. |
SkipNamedRanges | Don't copy named ranges. |
SkipPrintArea | Don't copy print area. |
SkipPrintRepeat | Don't copy print repeat |
SkipPrintFit | Don't copy print fit. |
SkipHorPageBreak | Don't copy horizontal page breaks. |
SkipComments | Don't copy cell comments. |
SkipFormats | Don't copy formats. |
SkipRowHidden | Don't copy hidden rows. |
SkipColHidden | Don't copy hidden columns. |
Merge two Excel documents:
# Load 2 existing books
Set Variable [ $$Book_WKPI ; Value: MBS( "XL.LoadBook"; SheetCopy::XLSX1; 0 ) ]
Set Variable [ $$Book_MKPI ; Value: MBS( "XL.LoadBook"; SheetCopy::XLSX2; 0 ) ]
#
# Make sure sheets have names
Set Variable [ $mbs ; Value: MBS( "XL.Sheet.SetName"; $$Book_MKPI; 0; "Monthly" ) ]
Set Variable [ $mbs ; Value: MBS( "XL.Sheet.SetName"; $$Book_WKPI; 0; "Weekly" ) ]
#
# copy one to other
Set Variable [ $mbs ; Value: MBS( "XL.CopySheet"; $$Book_MKPI; $$Book_WKPI; 0 ) ]
#
# save result in container
Set Variable [ $fileName ; Value: Substitute("Statistic__" & Substitute (Get(CurrentDate);".";"-") & "_" & Substitute(Get(CurrentTime); ":"; "-") & ".xlsx"; " Uhr"; "") ]
Set Field [ SheetCopy::ResultXLSX ; MBS("XL.Book.Save"; $$Book_WKPI; $fileName) ]
#
# save result to desktop
Set Variable [ $path ; Value: Get(DesktopPath) & $fileName ]
Export Field Contents [ SheetCopy::ResultXLSX ; “$Path” ; Automatically open ; Create folders: Off ]
#
# Cleanup
Set Variable [ $r ; Value: MBS( "XL.Book.Release"; $$Book_MKPI ) ]
Set Variable [ $r ; Value: MBS( "XL.Book.Release"; $$Book_WKPI ) ]
This function checks for a license.
Created 7th December 2016, last changed 16th September 2022