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