patrickyong / excellibrary

Automatically exported from code.google.com/p/excellibrary
1 stars 0 forks source link

Unintuitive exception thrown for Excel 5.0/95 format worksheets #94

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to Reproduce:
1. Save an Excel worksheet using the format Microsoft Excel 5.0/95
2. Provide the path to that worksheet to DataSetHelper.CreateDataSet()
3. An ArgumentNullException is thrown from System.IO.MemoryStream.

There isn't much reason for excellibrary to support such an old format, but a 
better error message might be useful. Is it possible to determine whether the 
file is in the correct format? If so, perhaps the code could throw some more 
specific Exception?

I'm using code checked out from the current trunk (r53).

Full StackTrace:
   at System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable)
   at System.IO.MemoryStream..ctor(Byte[] buffer)
   at ExcelLibrary.SpreadSheet.Workbook.Load(Stream stream)
   at ExcelLibrary.SpreadSheet.Workbook.Load(String file)
   at ExcelLibrary.DataSetHelper.CreateDataSet(String filePath)
   at TestExcelImport.Program.Main(String[] args) in c:\users\theuser\documents\visual studio 2010\Projects\TestExcelImport\TestExcelImport\Program.cs:line 12
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Original issue reported on code.google.com by etkl...@gmail.com on 2 Jun 2011 at 6:28

GoogleCodeExporter commented 9 years ago
same problem!

Original comment by martin.s...@webconomy.com on 12 Sep 2011 at 11:41