Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Introducedin
7.1.0.1855
7.1.0.1855
Description

Excerpt

Opens an existing Excel spreadsheet that is attached to a SharePoint List Item.

Signature
C#
C#
public static Workbook Open(this ExcelApplication excelApplication, Microsoft.SharePoint.SPListItem listItem, String fileName)
Signature
vb.net
vb.net
Public Shared Function Open(ByVal excelApplication As ExcelApplication, ByVal listItem As Microsoft.SharePoint.SPListItem, ByVal fileName As String) As Workbook
Parameters
Param
excelApplication
excelApplication

The current ExcelApplication object which is opening the file

Param
listItem
listItem

SharePoint List Item to which the file is attached

Param
fileName
fileName

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
Exception
System.Exception
System.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

This is an extension method for the ExcelApplication object to be used for opening spreadsheets from SharePoint List Items. To use this method, you must add a reference to SoftArtisans.OfficeWriter.ExcelWriter.SharePointIntegration.dll

Example
Code Block
csharp
csharp
titleC#

          Workbook wb = xla.Open(myListItem, "Report.xls");
        
Code Block
vb.net
vb.net
titlevb.net
Dim wb As Workbook = xla.Open(myListItem, "Report.xls")