Spread WPF 17
GrapeCity.Excel Namespace / ExcelOperator Class / Open Method / Open(String,Int32,String) Method
The excel document file name.
The index of loading ExcelWorksheet. If it's less that 0, means load all sheets.
The password to open the workbook. The default password is a null reference (Nothing in Visual Basic).


In This Topic
    Open(String,Int32,String) Method
    In This Topic
    Open an Excel document and load the worksheet which indicated by sheetIndex with password.
    Syntax
    'Declaration
     
    Public Overloads Sub Open( _
       ByVal file As String, _
       Optional ByVal sheetIndex As Integer, _
       Optional ByVal password As String _
    ) 
    'Usage
     
    Dim instance As ExcelOperator
    Dim file As String
    Dim sheetIndex As Integer
    Dim password As String
     
    instance.Open(file, sheetIndex, password)
    public void Open( 
       string file,
       int sheetIndex,
       string password
    )

    Parameters

    file
    The excel document file name.
    sheetIndex
    The index of loading ExcelWorksheet. If it's less that 0, means load all sheets.
    password
    The password to open the workbook. The default password is a null reference (Nothing in Visual Basic).
    Exceptions
    ExceptionDescription
    file contains only white space, or contains one or more invalid characters as defined by Path.GetInvalidPathChars().
    The file exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
    The specified file is invalid, (for example, it is on an unmapped drive).
    An I/O error occurred while opening the file.
    file specified a file that is read-only and access is not Read. file specified a directory. The caller does not have the required permission.
    The file specified in path was not found.
    file is in an invalid format.
    See Also