Win7, Vs2010 , silverlight 4
Hi, When i try to run this code, it trows exception like that "The type initializer for 'SR' threw an exception." on Workbook.Load().
Code from http://help.infragistics.com/Help/NetAdvantage/Silverlight/2010.2/CLR4.0/html/SL_Getting_Started_with_Infragistics_Excel_Engine.html
private void Button_Click(object sender, RoutedEventArgs e){ OpenFileDialog openfileDialog = new OpenFileDialog(); Workbook workbook1; // Open dialog if (openfileDialog.ShowDialog() == true) { // If user selected a file get the stream of that file FileStream stream = openfileDialog.File.OpenRead(); // Load workbook with data workbook1 = Workbook.Load(stream); stream.Close(); } }
private
void
object
new
// Open dialog
if
true
// If user selected a file get the stream of that file
// Load workbook with data
It is only work with excel file which is in infragistics samples. I open this file and save it again without any changes. Then it isn't work again.
Hi Anatolica.
My understanding is that the you can only use Excel files that come from Excel 97/2000/2002/2003/2007. It might be that when you open and save the file it is being saved as a different file version. EG if you have Office2010 , as I do, when I open a file from an older version of Excel, and try to save the file it automatically tries to convert it to Office 2010 format.
Anyway, it's just a thought.
Steve
Can you attached the file you are trying to open and I will see if I can create a sample with it.
It isn't actually. I tried to open excel file from folder of Infragistics Sample and It was worked. If it is saved again as 97-2003 excel version, it isn't worked.
Even if I'm using excel 2007, I paid attention to save as 97-2003 excel version.
In additional, I create new 97-2003 excel file (*.xls) and i tried it. Unfortunately it wasn't work too.