Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3    Statistic  


Loads a Excel file partially.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
XL 8.0 Yes Yes Yes Yes Yes
MBS( "XL.LoadBookPartially"; Data; SheetIndex; FirstRow; LastRow { ; Type } )   More


Parameter Description Example value
Data Either text with file path or container value which contains the Excel file data. "C:\test\test.xls"
SheetIndex The index of the sheet to delete. This number ranges from 0 to XL.Book.SheetCount-1. 0
FirstRow The first row index to load.
Starts with 0 for first one.
LastRow The last row index to load. 100
Type Optional
Which type of file this is.
Pass 0 for unknown, 1 to try xml format (xlsx) and 2 to try binary format (xls).


Returns book reference number on success.


Loads a Excel file partially.
Loads a file only with specified sheet index and row range into memory.
Works with both XML based xlsx files and older xls files.
Book reference numbers are starting at 19000 and counting up for each new book.


Try partial loading:

# Load second sheet
Set Variable [ $bookRef ; Value: MBS( "XL.LoadBookPartially"; XL::ExcelFile; 1; 0; 100) ]
Set Field [ XL::Result ; $bookRef ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Error" ; $bookRef ]
    Exit Script [ Text Result: ]
End If
# First row
# Save to container and cleanup
Set Field [ XL::OutputFile ; MBS("XL.Save"; $bookRef; "test.xlsx") ]
Set Variable [ $r ; Value: MBS( "XL.Book.Release"; $bookRef) ]
Set Field [ XL::Result ; $r ]

See also

Blog Entries

Created 10th January 2018, last changed 20th March 2018

XL.LoadBook   -   XL.NewBook

Feedback: Report problem or ask question.

MBS Xojo Plugins