Excerpt |
---|
Opens an existing Excel spreadsheet. |
Signature |
---|
C# | C# | Wiki Markup |
---|
{description}
{excerpt}Opens an existing Excel spreadsheet.{excerpt}
{signature:C#}
public virtual Workbook Open(System.String fileName)
|
Signature |
---|
{signature}{signature:vb.net | vb.net | }
Public Overridable Function Open(ByVal fileName As String) As Workbook
|
...
The path and name of the file to open. The path can be relative or absolute. The file must be a OOXML format (Excel 2007 or later) .xlsx file or BIFF8 format (Excel 97 or later) .xls file.
Returns |
---|
A Workbook object representing the file opened. |
...
If the file cannot be found or opened, or if ExcelWriter cannot parse the file as a OOXML or BIFF8 file.
Remarks |
---|
ExcelWriter supports Excel's OOXML (Excel 2007 or later) and BIFF8 (Excel 97 or later) format only. Do not use this method to open BIFF7 (Excel 95) files. |
Example |
---|
Code Block |
---|
| csharp | csharp |
title | C# |
---|
{signature}
{parameters}
{param:fileName}The path and name of the file to open. The path can be relative or absolute. The file must be a OOXML format \(Excel 2007 or later\) .xlsx file or BIFF8 format \(Excel 97 or later\) .xls file.{param}
{returns}A [Workbook|Workbook] object representing the file opened.{returns}
{exceptions}
{exception:System.Exception}If the file cannot be found or opened, or if ExcelWriter cannot parse the file as a OOXML or BIFF8 file.{exception}
{remarks}ExcelWriter supports Excel's OOXML \(Excel 2007 or later\) and BIFF8 \(Excel 97 or later\) format only. Do not use this method to open BIFF7 \(Excel 95\) files.
{remarks}
{example}{code:csharp|title=C#}
Workbook wb = xla.Open(@"C:\Reports\Report.xlsx");
Code Block |
---|
{code}
{code:vb.net
vb.net | title | |title=vb.net
}
Dim wb As Workbook = xla.Open("C:\Reports\Report.xlsx"){code}
{example}