Header menu logo ExcelProvider

ExcelProvider

Introduction

ExcelProvider is a library for F# that is designed to make importing or processing data from Excel files easy. It provides a type provider which provides type-safe read-only access to the contents of Excel files. The provider can access data organized in rows and columns in specified sheets or ranges.

The library can be installed from NuGet in the usual ways:

For use in a project, use the following command in the Package Manager Console:

PM> Install-Package ExcelProvider

For use in an F# script, use the following directive:

#r "nuget: ExcelProvider"

Example

This example demonstrates the use of the type provider:

alt text

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

// Let the type provider do it's work
type DataTypesTest = ExcelFile<"DataTypes.xlsx">
let file = new DataTypesTest()
let row = file.Data |> Seq.head

Now we have strongly typed access to the Excel rows:

alt text

row.String
val it : string = "A"
row.Float
val it : float = 1.0
row.Boolean
val it : bool = true

Documentation

For more information see the Documentation pages:

Contributing and copyright

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding new public API, please also consider adding samples that can be turned into a documentation. You might also want to read library design notes to understand how it works.

The library is available under Public Domain license, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.

Multiple items
namespace FSharp

--------------------
namespace Microsoft.FSharp
namespace FSharp.Interop
namespace FSharp.Interop.Excel
type DataTypesTest = 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: DataTypesTest
val row: ExcelFile<...>.Row
property ExcelFile<...>.Data: System.Collections.Generic.IEnumerable<ExcelFile<...>.Row> with get
module Seq from Microsoft.FSharp.Collections
val head: source: 'T seq -> 'T
property ExcelFile<...>.Row.String: string with get
property ExcelFile<...>.Row.Float: float with get
property ExcelFile<...>.Row.Boolean: bool with get

Type something to start searching.