Hi Everyone
I must thank the Infragistics team and also the other active members who gave me a wonderful support during my previous posts. The help provided by you all made to complete the module perfectly. I am back here with new doubts.
I have a ultrawingrid and i should import the Excel file with data to ultrawingrid. I tried with many of the codes but nothing i found to be useful. I am using Excel 2007 and Netadvantage for .NET CLR 2.0. I found something very close to what i needed but it works only for previous versions of Excel 2007. The code which i tried is below
fileLocation = OpenFileDialog.FileName;
for .NET CLR 2.0
internalWorkbook = Infragistics.Excel.Workbook.Load(fileLocation);
It stands error on the 2nd line itself with a message
The specified stream or file does not contain a valid workbook. Parameter name: fileName
I dont know where i have gone wrong. Can anyone suggest me with some of the ideas to overcome this issue and acheive Importing the data to Excel
Thanks in advance
Ferdin
What version of NetAdvantage for .NET are you using?
The ability to read an Excel 2007 file was added in NetAdvantage for .NET 2008 Volume 3. If you're using an earlier version, then this result is expected.
If you're using 2008 Volume 3, then are you referring to the "Infragistics3.Excel" assembly (rather than the Infragistics2.Excel assembly)? The Infragistics2.Excel assembly can't read an Excel 2007 format out-of-the-box. To use the Infragistics3.Excel assembly, you need to have a CLR 3.0 or CLR 3.5 application.
Vince
Thanks for your reply. I am using NetAdvantage for .NET CLR 2.0.
ferdin said:Thanks for your reply. I am using NetAdvantage for .NET CLR 2.0.
Resolved the issue
Thanks. :)
Hi I am working on importing an excel file and getting the same error.
An exception of type 'System.ArgumentException' occurred in Infragistics4.Documents.Core.v15.2.dll but was not handled in user code
Additional information: The specified stream or file does not contain a valid workbook.
It would be really helpful if anyone can suggest me with some of the ideas to overcome this issue
ayrus,
I recommend that you pursue these specific issues by submitting support requests, than through the forums, because it will likely take some in-depth research to determine what's happening. Each of these is a separate issue, so each should be logged as a separate support request. You should include the sample project you're working with in each support request, so that Developer support can better see what code you're using.
Thanks for the confirmation.
The ability to read Excel 2007 files was added in NetAdvantage for .NET 2008 Volume 3, so it's expected that NetAdvantage for .NET 2008 Volume 2 would nto be able to read an Excel 2007 workbook. The error message is basically saying that the file being loaded is not a valid Excel 97-2003 workbook, which is accurate.
To be able to read Exel 2007 workbooks, I suggest you upgrade to NetAdvantage for .NET 2008 Volume 3. You will also need to either move to a CLR 3.0 or CLR 3.5 application, or to implement your own compression and packaging logic if your application must continue to target CLR 2.0. Refer to the following article from our online help documentation of NetAdvantage for .NET 2008 Volume 3 for more information on this:Office 2007 XLSX file generation references and dependencies
I am using NetAdvantage for .NET 2008 Vol. 2 CLR 2.0