We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

"File does not contains workbook stream" Error message

Hello Trying to open an excel file (generated by Crystal Reports) and getting this error "File does not contains workbook stream" Your example from "http://www.syncfusion.com/support/issues/includes/attachments/552_Copying Worksheet To Another Workbook.zip" with your test Excel files works fine. Could you help me with this issue plase. Thanks! -- Ilya //this fails IWorkbook wb_src = ExcelUtils.Open(srcFileName); //this fails too ExcelEngine excelEngine = new ExcelEngine(); IApplication application = excelEngine.Excel; IWorkbook wb_src = excelEngine.Excel.Workbooks.Open(srcFileName); ================================================= Error Message: System.ApplicationException: File does not contains workbook stream at Syncfusion.ExcelRW.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String FileName, ExcelParseOptions options) at Syncfusion.ExcelRW.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String FileName) at Syncfusion.ExcelRW.Implementation.ApplicationImpl.CreateWorkbook(Object parent, String strTemplateFile) at Syncfusion.ExcelRW.Implementation.Collections.WorkbooksCollection.Open(String Filename) at ExcelMergeRW.Class1.Test2() in c:\projects\excelmergeprojects\excelmergerw\class1.cs:line 66 at ExcelMergeRW.Class1.Main(String[] args) in c:\projects\excelmergeprojects\excelmergerw\class1.cs:line 94 An unhandled exception of type ''Syncfusion.ExcelRW.ExcelWorkbookNotSavedException'' occurred in syncfusion.excelrw.base.dll 01_422.zip

7 Replies

AD Administrator Syncfusion Team September 20, 2005 04:58 AM UTC

>Hello > >Trying to open an excel file (generated by Crystal Reports) and getting this error "File does not contains workbook stream" > >Your example from "http://www.syncfusion.com/support/issues/includes/attachments/552_Copying Worksheet To Another Workbook.zip" with your test Excel files works fine. > >Could you help me with this issue plase. > >Thanks! > >-- Ilya > >//this fails >IWorkbook wb_src = ExcelUtils.Open(srcFileName); > >//this fails too >ExcelEngine excelEngine = new ExcelEngine(); >IApplication application = excelEngine.Excel; >IWorkbook wb_src = excelEngine.Excel.Workbooks.Open(srcFileName); > > >================================================= >Error Message: >System.ApplicationException: File does not contains workbook stream > at Syncfusion.ExcelRW.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String FileName, ExcelParseOptions options) > at Syncfusion.ExcelRW.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String FileName) > at Syncfusion.ExcelRW.Implementation.ApplicationImpl.CreateWorkbook(Object parent, String strTemplateFile) > at Syncfusion.ExcelRW.Implementation.Collections.WorkbooksCollection.Open(String Filename) > at ExcelMergeRW.Class1.Test2() in c:\projects\excelmergeprojects\excelmergerw\class1.cs:line 66 > at ExcelMergeRW.Class1.Main(String[] args) in c:\projects\excelmergeprojects\excelmergerw\class1.cs:line 94 >An unhandled exception of type ''Syncfusion.ExcelRW.ExcelWorkbookNotSavedException'' occurred in syncfusion.excelrw.base.dll > > > >01_422.zip > > Try this code: using(ExcelEngine engine = new ExcelEngine()) { engine.ThrowNotSavedOnDestroy = false; IApplication application = engine.Excel; IWorkbook wb = application.Workbooks.Open(srcFileName); // enjoy the work wb.Close(); } // RTFM ;)


AD Administrator Syncfusion Team September 20, 2005 12:33 PM UTC

Hi Ilya, It works fine for me. I herewith attach a Sample using your file, see to it and please let me know if you have further questions. OpeningASpreadsheet_9764.zip Best Regards, Seetha >Hello > >Trying to open an excel file (generated by Crystal Reports) and getting this error "File does not contains workbook stream" > >Your example from "http://www.syncfusion.com/support/issues/includes/attachments/552_Copying Worksheet To Another Workbook.zip" with your test Excel files works fine. > >Could you help me with this issue plase. > >Thanks! > >-- Ilya > >//this fails >IWorkbook wb_src = ExcelUtils.Open(srcFileName); > >//this fails too >ExcelEngine excelEngine = new ExcelEngine(); >IApplication application = excelEngine.Excel; >IWorkbook wb_src = excelEngine.Excel.Workbooks.Open(srcFileName); > > >================================================= >Error Message: >System.ApplicationException: File does not contains workbook stream > at Syncfusion.ExcelRW.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String FileName, ExcelParseOptions options) > at Syncfusion.ExcelRW.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, String FileName) > at Syncfusion.ExcelRW.Implementation.ApplicationImpl.CreateWorkbook(Object parent, String strTemplateFile) > at Syncfusion.ExcelRW.Implementation.Collections.WorkbooksCollection.Open(String Filename) > at ExcelMergeRW.Class1.Test2() in c:\projects\excelmergeprojects\excelmergerw\class1.cs:line 66 > at ExcelMergeRW.Class1.Main(String[] args) in c:\projects\excelmergeprojects\excelmergerw\class1.cs:line 94 >An unhandled exception of type ''Syncfusion.ExcelRW.ExcelWorkbookNotSavedException'' occurred in syncfusion.excelrw.base.dll > > > >01_422.zip > >


AD Administrator Syncfusion Team September 20, 2005 03:31 PM UTC

Hi Seetha Thanks for looking into this. Yes, I do see that it works fine. I did not submit the original 01.xls, but the one I alterated by changing all the actual data to the strings like "aaa", "bbb" ... The original 01.xls is an Excel file generated by Crystal Reports and that file caused the problem. So the file you saw was created by Excel, the problem file was generated by Crystal Reports. Have you had any issues with Crystal Reports generated Excel files? Thanks -- Ilya >Hi Ilya, > >It works fine for me. I herewith attach a Sample using your file, see to it and please let me know if you have further questions. > >OpeningASpreadsheet_9764.zip > >Best Regards, >Seetha >


AD Administrator Syncfusion Team September 21, 2005 12:10 PM UTC

Hi Ilya, 1) Since the file was produced by a vendor other than Microsoft it is likely that the implementation for creating Native Excel files has a bug. This is mainly because the BIFF8 file format information published by Microsoft is incomplete and a lot of records are undocumented so the developers have to rely on trial and error to find out the undocumented Biff record structures. However, this process can be error prone and it causes imperfect BIFF8 files to be produced. The reason why Microsoft Excel is able to view these damaged files is that MS Excel has a lot more information about the file format, so it is able to guess wrong records and repair them when necessary. 2) we have not tested compatibility of XlsIO with spreadsheets produced by Crystal Reports. However, we do have plans to make XlsIO more robust in handling imperfect files but it would be atlease 8+ weeks before we can provide an updated build that handles Crystal reports files better. 3) Till that time, please create a Direc-Trac incident with the specific files that you are having problems with and we wil try to fix them as soon as possible. Thanks, Stephen. >Hi Seetha >Thanks for looking into this. >Yes, I do see that it works fine. > >I did not submit the original 01.xls, but the one I alterated by changing all the actual data to the strings like "aaa", "bbb" ... > >The original 01.xls is an Excel file generated by Crystal Reports and that file caused the problem. > >So the file you saw was created by Excel, the problem file was generated by Crystal Reports. > >Have you had any issues with Crystal Reports generated Excel files? > >Thanks > >-- Ilya > > > >>Hi Ilya, >> >>It works fine for me. I herewith attach a Sample using your file, see to it and please let me know if you have further questions. >> >>OpeningASpreadsheet_9764.zip >> >>Best Regards, >>Seetha >> >


AD Administrator Syncfusion Team September 21, 2005 01:59 PM UTC

Hello Stephen, thank you for a very detailed answer. I may submit that Crystal-generated (corrupted) Excel file though Direc-Trac so you may tweak your classes correspondingly. Best regards, -- Ilya >Hi Ilya, > >1) Since the file was produced by a vendor other than Microsoft it is likely that the implementation for creating Native Excel files has a bug. This is mainly because the BIFF8 file format information published by Microsoft is incomplete and a lot of records are undocumented so the developers have to rely on trial and error to find out the undocumented Biff record structures. However, this process can be error prone and it causes imperfect BIFF8 files to be produced. The reason why Microsoft Excel is able to view these damaged files is that MS Excel has a lot more information about the file format, so it is able to guess wrong records and repair them when necessary. > >2) we have not tested compatibility of XlsIO with spreadsheets produced by Crystal Reports. However, we do have plans to make XlsIO more robust in handling imperfect files but it would be atlease 8+ weeks before we can provide an updated build that handles Crystal reports files better. > >3) Till that time, please create a Direc-Trac incident with the specific files that you are having problems with and we wil try to fix them as soon as possible. > >Thanks, > >Stephen.


SK Sailaja Kowkuntla January 16, 2018 06:52 AM UTC

I am unable to open attached file. password: january. I used IWorkbook Open(string strFileName, ExcelParseOptions options, bool bReadOnly, string password);
Exeception:
  at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseStgStream(ICompoundStorage storage, ExcelParseOptions options, String password)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseStream(Stream stream, String password, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options, Boolean bReadOnly, String password, ExcelVersion version)
   at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelParseOptions options, Boolean bReadOnly, String password, ExcelVersion version)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelParseOptions options, Boolean isReadOnly, String password, ExcelVersion excelVersion)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelParseOptions options, Boolean isReadOnly, String password)
Attachment: Master_Approvals_List_5aec4f27.zip


AV Abirami Varadharajan Syncfusion Team January 16, 2018 01:19 PM UTC

Hi Sailaja, 

Thank you for contacting Syncfusion support. 

We are able to reproduce the issue. The issue occurs while trying to parse XLSX file as binary file format. This is because, the application default version is not set while opening the file as stream. It is recommended to set the application version as Excel2007 or above before opening a file stream to resolve the issue. Please refer below code for the same. 

application.DefaultVersion = ExcelVersion.Excel2013; 

Kindly try and let us know that the issue is resolved at your end. 

Regards, 
Abirami. 


Loader.
Live Chat Icon For mobile
Up arrow icon