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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error When Un-loading Windows form

Thread ID:

Created:

Updated:

Platform:

Replies:

34591 Sep 13,2005 01:09 PM UTC Sep 19,2005 09:16 AM UTC WinForms 4
loading
Tags: XlsIO
Mohammad Abdullah
Asked On September 13, 2005 01:09 PM UTC

Hi I have problem when Un-loading some form after loading (displaying) an excel file , after closing the file and if I want to Un-load the form that opens the excel file sheet it gives me the following run time error : An unhandled exception of type ''Syncfusion.ExcelRW.ExcelWorkbookNotSavedException'' occurred in syncfusion.excelrw.dll Additional information: Excel Binary workbook was not saved. Object can not be disposed. Save workbook or set property ThrowNotSavedOnDestoy to false. Here is my code in case of saving the excel file: excelEngine.ThrowNotSavedOnDestroy = true; //SheetAll.Protect("syncfusion"); myWorkbook.SaveAs(Application.StartupPath + @"\\Reports\\repStatTypeDept.xls"); excelEngine.Dispose(); //Launching the Excel file using the default Application.[MS Excel Or Free ExcelViewer] System.Diagnostics.Process.Start(Application.StartupPath + @"\\Reports\\repStatTypeDept.xls"); The Excelrw version Is (2.1.0.9). So how I can avoid this error?

Administrator [Syncfusion]
Replied On September 14, 2005 04:52 AM UTC

>Hi > >I have problem when Un-loading some form after loading (displaying) an excel file , after closing the file and if I want to Un-load the form that opens the excel file sheet it gives me the following run time error : > >An unhandled exception of type ''Syncfusion.ExcelRW.ExcelWorkbookNotSavedException'' occurred in syncfusion.excelrw.dll > >Additional information: Excel Binary workbook was not saved. Object can not be disposed. Save workbook or set property ThrowNotSavedOnDestoy to false. > >Here is my code in case of saving the excel file: > >excelEngine.ThrowNotSavedOnDestroy = true; >//SheetAll.Protect("syncfusion"); >myWorkbook.SaveAs(Application.StartupPath + @"\\Reports\\repStatTypeDept.xls"); >excelEngine.Dispose(); >//Launching the Excel file using the default Application.[MS Excel Or Free ExcelViewer] >System.Diagnostics.Process.Start(Application.StartupPath + @"\\Reports\\repStatTypeDept.xls"); > >The Excelrw version Is (2.1.0.9). >So how I can avoid this error? > First way: excelEngine.ThrowNotSavedOnDestroy = false; Second way: catch the exception ;)

Administrator [Syncfusion]
Replied On September 14, 2005 10:57 AM UTC

Hi Mohammad, Change the Code as: excelEngine.ThrowNotSavedOnDestroy = false; This line throws no exception if there are unsaved workbooks. Best Regards, Seetha >Hi > >I have problem when Un-loading some form after loading (displaying) an excel file , after closing the file and if I want to Un-load the form that opens the excel file sheet it gives me the following run time error : > >An unhandled exception of type ''Syncfusion.ExcelRW.ExcelWorkbookNotSavedException'' occurred in syncfusion.excelrw.dll > >Additional information: Excel Binary workbook was not saved. Object can not be disposed. Save workbook or set property ThrowNotSavedOnDestoy to false. > >Here is my code in case of saving the excel file: > >excelEngine.ThrowNotSavedOnDestroy = true; >//SheetAll.Protect("syncfusion"); >myWorkbook.SaveAs(Application.StartupPath + @"\\Reports\\repStatTypeDept.xls"); >excelEngine.Dispose(); >//Launching the Excel file using the default Application.[MS Excel Or Free ExcelViewer] >System.Diagnostics.Process.Start(Application.StartupPath + @"\\Reports\\repStatTypeDept.xls"); > >The Excelrw version Is (2.1.0.9). >So how I can avoid this error? >

Mohammad Abdullah
Replied On September 17, 2005 08:10 AM UTC

I did your recommendations but nothing changed the problem not resolved and the same message displayed.

Administrator [Syncfusion]
Replied On September 19, 2005 09:16 AM UTC

Hi Mohammad, I tested with the version 2.1.0.9, it works fine. Can you please send me the file. Sorry for the Inconvenience. Thanks, Seetha >I did your recommendations but nothing changed the problem not resolved and the same message displayed.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;