Header menu logo ExcelProvider

Accessing Rows

Rows are returned as a sequence from the Data element of the ExcelFile type.

Example

alt text

This example demonstrates loading the second row (with index 1) into the variable test:

// reference the type provider
open FSharp.Interop.Excel

// Let the type provider do it's work
type MultipleSheetsSecond = ExcelFile<"MultipleSheets.xlsx", "B">
let file = new MultipleSheetsSecond()
let rows = file.Data |> Seq.toArray
let test = rows.[1]

And the variable test has the following value:

Row 2
	Fifth = 02/01/2013 00:00:00
	Fourth = 3.2
Multiple items
namespace FSharp

--------------------
namespace Microsoft.FSharp
namespace FSharp.Interop
namespace FSharp.Interop.Excel
type MultipleSheetsSecond = ExcelFile<...>
type ExcelFile = inherit ExcelFileInternal
<summary>Typed representation of data in an Excel file.</summary> <param name='FileName'>Location of the Excel file.</param> <param name='SheetName'>Name of sheet containing data. Defaults to first sheet.</param> <param name='Range'>Specification using `A1:D3` type addresses of one or more ranges. Defaults to use whole sheet.</param> <param name='HasHeaders'>Whether the range contains the names of the columns as its first line.</param> <param name='ForceString'>Specifies forcing data to be processed as strings. Defaults to `false`.</param>
val file: MultipleSheetsSecond
val rows: ExcelFile<...>.Row array
property ExcelFile<...>.Data: System.Collections.Generic.IEnumerable<ExcelFile<...>.Row> with get
module Seq from Microsoft.FSharp.Collections
val toArray: source: 'T seq -> 'T array
val test: ExcelFile<...>.Row

Type something to start searching.