Search Results for

    Show / Hide Table of Contents

    Class LoadingOptions

    Options for loading WorkBook object from file.

    Inheritance
    System.Object
    LoadingOptions
    Namespace: IronXL.Options
    Assembly: IronXL.dll
    Syntax
    public class LoadingOptions : Object

    Opening a workbook that needs special handling on the way in runs through LoadingOptions. It is the settings object a developer supplies when loading a file so that CSV parsing, an encryption password, and the working format are all decided before the data is read, rather than fixed up afterward.

    Set the properties that match the source file, then pass the options to the load call. Password supplies the password for an encrypted workbook so it can be opened. For delimited text, CsvListDelimiter sets the separator (its default follows the current region's culture), CsvIgnoreQuotes controls whether quote characters are treated literally, and ConvertFieldValues, true by default, parses each field's value into a typed cell rather than leaving raw text. DefaultFileFormat is an ExcelFileFormat value that picks XLS or XLSX as the in-memory format when loading CSV or TSV, with XLSX as the default. Set only the properties a given file requires; the parameterless constructor leaves the rest at their documented defaults.

    using IronXL.Options;
    
    var options = new LoadingOptions();
    options.Password = "secret";
    options.CsvListDelimiter = ",";

    The load a spreadsheet how-to opens files of several types, and the read CSV file how-to covers delimited input.

    Constructors

    LoadingOptions()

    Declaration
    public LoadingOptions()

    Properties

    ConvertFieldValues

    Property that indicates whether to convert field values when loading CSV/TSV files.

    Default value is TRUE.

    Declaration
    public bool ConvertFieldValues { get; set; }
    Property Value
    Type Description
    System.Boolean

    CsvIgnoreQuotes

    Property that indicates whether to ignore quotes when loading CSV files.

    Default value is false.

    Declaration
    public bool CsvIgnoreQuotes { get; set; }
    Property Value
    Type Description
    System.Boolean

    CsvListDelimiter

    Property that indicates CSV file list delimiter.

    Default value depends on current region. Take a look at System.Globalization.CultureInfo

    Declaration
    public string CsvListDelimiter { get; set; }
    Property Value
    Type Description
    System.String

    DefaultFileFormat

    Property that indicates whether to use XLS or XLSX as new workbook format when loading CSV/TSV files.

    XLSX is the default value for new workbook

    Declaration
    public ExcelFileFormat DefaultFileFormat { get; set; }
    Property Value
    Type Description
    ExcelFileFormat

    Password

    Get or set a password for a workbook.

    Declaration
    public string Password { get; set; }
    Property Value
    Type Description
    System.String
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget