This project has moved. For the latest updates, please go here.

An exception occurred in the type initializer for 'ClosedXML.Excel.XLWorkbook'.

Jul 28, 2012 at 3:06 PM

Help me please. 

 

Code: 

 

FileStream fsFile = new FileStream("D:\\myFile.xlsx", FileMode.OpenOrCreate);       

var myBook = new XLWorkbook(fsFile );

 

Exception: An exception occurred in the type initializer for 'ClosedXML.Excel.XLWorkbook'.

Coordinator
Jul 28, 2012 at 3:48 PM

The file you're loading is new, therefore it's empty.