Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Wiki Markup
{introducedin:7.1.0.1855

...

Description

Excerpt

Opens an existing Excel spreadsheet from a SharePoint Document Library.

Signature
C#C#
}
{description}
{excerpt}Opens an existing Excel spreadsheet from a SharePoint Document Library.{excerpt}
{signature:C#}
public static Workbook Open(this ExcelApplication excelApplication, Microsoft.SharePoint.SPDocumentLibrary docLib, String fileName)
Signature
{signature}{signature:vb.net
vb.net
}
Public Shared Function Open(ByVal excelApplication As ExcelApplication, ByVal docLib As Microsoft.SharePoint.SPDocumentLibrary, ByVal fileName As String) As Workbook
Parameters

...

The current ExcelApplication object which is opening the file

...

SharePoint Document Library that contains the Excel spreadsheet being opened

...

The name of the file to open. The file must be a BIFF8 format (Excel 97 or later) .xls or .xlt file.

Returns

A Workbook object representing the file opened.

Exceptions
This is an extension method for the ExcelApplication object to be used for opening spreadsheets from SharePoint Document Libraries. To use this method, you must add a reference to
{signature}
{parameters}
{param:excelApplication}The current ExcelApplication object which is opening the file
{param}
{param:docLib}SharePoint Document Library that contains the Excel spreadsheet being opened
{param}
{param:fileName}The name of the file to open. The file must be a BIFF8 format \(Excel 97 or later\) .xls or .xlt 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 BIFF8 file.{exception}
{remarks}
ExcelWriter supports  Excel's BIFF8 \(Excel 97 or later\) format only.  Do not use  this method  to open BIFF7 \(Excel 95\) files.
{note}This is an extension method for the ExcelApplication object to be used for opening spreadsheets from SharePoint Document Libraries.  To use this method, you must add a reference to SoftArtisans.OfficeWriter.ExcelWriter.SharePointIntegration.dll
{note}
{remarks}
{example}{code:csharp|title=C#}

          Workbook wb = xla.Open(myDocLib, "Report.xls");
        
{code}
{code:vb.net
|title=vb.net
}
Dim wb As Workbook = xla.Open(myDocLib, "Report.xls"){code}

{example}
Exception
System.ExceptionSystem.Exception

If the file cannot be found or opened, or if ExcelWriter cannot parse the file as a BIFF8 file.

Remarks

ExcelWriter supports Excel's BIFF8 (Excel 97 or later) format only. Do not use this method to open BIFF7 (Excel 95) files.

Note
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle