Spread WPF Documentation
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).
Open an Excel document and load the worksheet which indicated by sheetIndex with password.
Syntax
'Declaration
 
Public Overloads Sub Open( _
   ByVal file As System.String, _
   Optional ByVal sheetIndex As System.Integer, _
   Optional ByVal password As System.String _
) 
'Usage
 
Dim instance As ExcelOperator
Dim file As System.String
Dim sheetIndex As System.Integer
Dim password As System.String
 
instance.Open(file, sheetIndex, password)
public void Open( 
   System.string file,
   System.int sheetIndex,
   System.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
System.ArgumentExceptionfile contains only white space, or contains one or more invalid characters as defined by Path.GetInvalidPathChars().
System.IO.PathTooLongExceptionThe 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.
System.IO.DirectoryNotFoundExceptionThe specified file is invalid, (for example, it is on an unmapped drive).
System.IO.IOExceptionAn I/O error occurred while opening the file.
System.UnauthorizedAccessExceptionfile specified a file that is read-only and access is not Read. file specified a directory. The caller does not have the required permission.
System.IO.FileNotFoundExceptionThe file specified in path was not found.
System.NotSupportedExceptionfile is in an invalid format.
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional (SP4), Windows XP (SP2), Windows 2008, Windows 2003 Server (SP1)

See Also

Reference

ExcelOperator Class
ExcelOperator Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.