Open an Excel document and load the worksheet which indicated by with password.
Syntax
'Declaration
Public Overloads Sub Open( _
ByVal As System.String, _
Optional ByVal As System.Integer, _
Optional ByVal 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 ,
System.int ,
System.string
)
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
Exception | Description |
System.ArgumentException | contains only white space,
or contains one or more invalid characters as defined by Path.GetInvalidPathChars(). |
System.IO.PathTooLongException | The 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.DirectoryNotFoundException | The specified is invalid, (for example, it is on an unmapped drive). |
System.IO.IOException | An I/O error occurred while opening the . |
System.UnauthorizedAccessException | specified a file that is read-only and access is not Read.
specified a directory.
The caller does not have the required permission. |
System.IO.FileNotFoundException | The specified in path was not found. |
System.NotSupportedException | is in an invalid format. |
See Also