Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: Exception when creating or loading workbook: When using relative paths, make sure the current directory is correct.

$
0
0
I'm getting an exception with only a single line of code;
    static void Main(string[] args)
    {
        XLWorkbook workbook = new XLWorkbook(); 
    }
"The type initializer for 'ClosedXML.Excel.XLWorkbook' threw an exception."
"InnerException: When using relative paths, make sure the current directory is correct."

This must be a configuration error? I've added "ClosedXML" and "DocumentFormat.OpenXml" to References. I also get this exception trying to load a workbook.

It has been a frustrating day of Koogra, NPOI, OpenXML! They all seem to have their quirks. All I really want to do is dump the cell contents of every named range in a workbook. With OpenXML I couldn't get it to write dates properly and cycling through each cell in the range was quirky. I've tried multiple StackOverlfow examples.

I Googled the exact text of the exception & it doesn't appear anywhere.

Thanks in advance for any ideas.

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>