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

InvalidCastException if some of cells in string column are numeric #14

Closed vilinski closed 2 months ago

vilinski commented 9 years ago

Occurs if enumerate all rows. As a workaround i have selected the entire column and set format to text

System.InvalidCastException: Unable to cast object of type 'System.Double' to type 'System.String'. at FSI_0073.it@245-18.Invoke(Row x) in my.fsx:line 245 at Microsoft.FSharp.Collections.IEnumerator.map@107.DoMoveNext(b& ) at Microsoft.FSharp.Collections.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) at <StartupCode$FSI_0073>.$FSI_0073.main@() Stopped due to error

alexfoxgill commented 8 years ago

I have this problem too. Same workaround - format column to Text. would be nice if the type provider could automatically call ToString where necessary

quintusm commented 2 months ago

I believe that this issue is resolved by v3.0.0 which has just been uploaded to Nuget.