0

I use the following code to read in an excel file creating a package:

Public _package As ExcelPackage = Nothing

  Dim flInfo As New FileInfo(FILENAME)
  _package = New ExcelPackage(flInfo) 'load the excel file

This code is great when I want to load an entire file, but sometimes whether due to my local hardware issues or limitations with Epplus itself, if my file size exceeds 100MB then the import process crashes.

Therefore is there a way of loading part of an excel file into an EPPLUS package, in fact is it possible to pick and select certain portions of the Excel file?

Many thanks

Eddy Jawed
  • 457
  • 6
  • 17
  • What do you mean crashes? What's the exception? What's line does it happen at? – mason Apr 30 '15 at 18:13
  • It doesn't throw an exception, I just get a frozen screen which I believe is memory related. Therefore I am trying to read in portions a bit at a time to get it in. Some files are huge. – Eddy Jawed Apr 30 '15 at 18:14
  • EPPlus can't read data in chunks, nor can any application that opens Excel documents because of the file format. But your own program can only selectively get portions of the data from EPPlus if you want. I doubt your problem is memory related. See if your program reaches the line after your `New ExcelPackage` line. – mason Apr 30 '15 at 18:16
  • Yes importing it again, small files process no problem, but huge files never get past the package line. – Eddy Jawed Apr 30 '15 at 18:27
  • I have one idea to create SSIS package instead, on the fly using VB – Eddy Jawed Apr 30 '15 at 18:28

1 Answers1

1

How many rows and columns of data do you have? EPPlus has trouble when the file gets too big. Version 4 improved it much but did not solve it. Unfortunately, there is no great work around:

EPPlus, handling big ExcelWorksheet

Community
  • 1
  • 1
Ernie S
  • 13,902
  • 4
  • 52
  • 79