fsprojects / ExcelProvider

This library is for the .NET platform implementing a Excel type provider.
http://fsprojects.github.io/ExcelProvider/
The Unlicense
141 stars 51 forks source link

Add optional sheetName instance constructor parameter #29

Open ntr opened 8 years ago

ntr commented 8 years ago

Description

I have a file with multiple sheets and they share the same structure. I would like to generate type from the first sheet and after that instantiate my type on each of the sheets. It can be done by adding optional sheetName parameter to instance constructor.

Expected behavior

type MonthlyData = FSharp.ExcelProvider.ExcelFile< @"c:\tmp\x.xlsx", "JAN"> let data =["JAN"; "FEB"; "MAR"] |> List.map (fun x -> MonthlyData(@"c:\tmp\x.xlsx", x)))

abelbraaksma commented 3 years ago

Not sure why this wasn't closed, but the thing you're requesting here currently works exactly as you've written it: you can provide a 2nd argument to the constructor at runtime to designate the sheetname for your type provider.