Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: Invalid Excel OpenXml file (*.xlsx).

$
0
0

Hi,

I am using the following piece of code to load the xlsx.

var openFileDialog1 = new OpenFileDialog
{
Filter = "Files (.xlsx)|*.xlsx|All Files (*.*)|*.*",
FilterIndex = 1
};

if (openFileDialog1.ShowDialog() == true)
{
FileInfo fInfo = openFileDialog1.File;

using (var fileStream = fInfo.OpenRead())
{
var book = new C1XLBook();
book.Load(fileStream, FileFormat.OpenXml);
}
}
selecting the Sample.xlsx file through open file dialog. Then receiving the error – Exception Invalid Excel OpenXml file (*.xlsx).

Thanks,
Sai


Viewing all articles
Browse latest Browse all 14170

Trending Articles



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