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

Delete Worksheet Problem

Hi, I received a System.NullReferenceException from the excelrw.dll when I called myWorkBook.Worksheets.Remove("Sheet1"). I checked the active workbook and confirmed it has the worksheet - "Sheet1". Any ideas or suggestions? Thanks in advance.

5 Replies

AD Administrator Syncfusion Team October 14, 2004 03:24 PM UTC

Hi, Could you please post your sample or the code snippet that you are using and also the version of ExcelRW that you are using. Thanks. Best regards, Stephen. >Hi, > >I received a System.NullReferenceException from the excelrw.dll when I called myWorkBook.Worksheets.Remove("Sheet1"). I checked the active workbook and confirmed it has the worksheet - "Sheet1". > >Any ideas or suggestions? > >Thanks in advance.


AD Administrator Syncfusion Team October 14, 2004 03:34 PM UTC

Thanks for the quick reply. Belows are the code that I used for testing the Remove method: public void TestWorkBook () { // Create a workbook with 2 worksheets IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(2); // Delete the first worksheet // I received exception as soon as I call the Remove method myWorkBook.WorkSheets.Remove("Sheet1"); } My ExcelRW version number is 1.1.4322 Thanks again. >Hi, > >Could you please post your sample or the code snippet that you are using and also the version of ExcelRW that you are using. Thanks. > >Best regards, > >Stephen. > > >>Hi, >> >>I received a System.NullReferenceException from the excelrw.dll when I called myWorkBook.Worksheets.Remove("Sheet1"). I checked the active workbook and confirmed it has the worksheet - "Sheet1". >> >>Any ideas or suggestions? >> >>Thanks in advance.


AD Administrator Syncfusion Team October 14, 2004 07:05 PM UTC

Hi, I tried to reproduce the problem using this sample with the code snippet that you had provided but it seems to work fine for me. F20341DeleteWorksheet_5280.zip Please take a look at the attached sample and let me know if you see the problem in this sample also. Could you please confirm the version of ExcelRW since the latest version available for download is version 2.1.0.9 and we did not have the version number that you have specified. One other thing you can look for is to make sure that the spelling of sheet1 is case sentitive it should be ''Sheet1'' and not ''sheet1''. Thanks. Best regards, Stephen. >Thanks for the quick reply. > >Belows are the code that I used for testing the Remove method: > >public void TestWorkBook () >{ >// Create a workbook with 2 worksheets >IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(2); > >// Delete the first worksheet >// I received exception as soon as I call the Remove method >myWorkBook.WorkSheets.Remove("Sheet1"); >} > >My ExcelRW version number is 1.1.4322 > >Thanks again. > > >>Hi, >> >>Could you please post your sample or the code snippet that you are using and also the version of ExcelRW that you are using. Thanks. >> >>Best regards, >> >>Stephen. >> >> >>>Hi, >>> >>>I received a System.NullReferenceException from the excelrw.dll when I called myWorkBook.Worksheets.Remove("Sheet1"). I checked the active workbook and confirmed it has the worksheet - "Sheet1". >>> >>>Any ideas or suggestions? >>> >>>Thanks in advance.


AD Administrator Syncfusion Team October 15, 2004 10:42 AM UTC

Hi, Here is my testing results. The sample works fine with ExcelRW ver. 2.0.5.1. However, I received the same exception if I used ExcelRW ver. 2.0.5.43. Thanks >Hi, > >I tried to reproduce the problem using this sample with the code snippet that you had provided but it seems to work fine for me. > >F20341DeleteWorksheet_5280.zip > >Please take a look at the attached sample and let me know if you see the problem in this sample also. > >Could you please confirm the version of ExcelRW since the latest version available for download is version 2.1.0.9 and we did not have the version number that you have specified. > > >One other thing you can look for is to make sure that the spelling of sheet1 is case sentitive it should be ''Sheet1'' and not ''sheet1''. >Thanks. > >Best regards, > >Stephen. >>Thanks for the quick reply. >> >>Belows are the code that I used for testing the Remove method: >> >>public void TestWorkBook () >>{ >>// Create a workbook with 2 worksheets >>IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(2); >> >>// Delete the first worksheet >>// I received exception as soon as I call the Remove method >>myWorkBook.WorkSheets.Remove("Sheet1"); >>} >> >>My ExcelRW version number is 1.1.4322 >> >>Thanks again. >> >> >>>Hi, >>> >>>Could you please post your sample or the code snippet that you are using and also the version of ExcelRW that you are using. Thanks. >>> >>>Best regards, >>> >>>Stephen. >>> >>> >>>>Hi, >>>> >>>>I received a System.NullReferenceException from the excelrw.dll when I called myWorkBook.Worksheets.Remove("Sheet1"). I checked the active workbook and confirmed it has the worksheet - "Sheet1". >>>> >>>>Any ideas or suggestions? >>>> >>>>Thanks in advance. > > > >


AD Administrator Syncfusion Team October 19, 2004 03:20 PM UTC

Hi, I tested with the latest internal patch and it works fine. Could you please consider upgrading to version 2.1 of ExcelRW since it has a lot of improvements over version 2.0.5.43. Thanks. Best regards, Stephen. >Hi, > >Here is my testing results. > >The sample works fine with ExcelRW ver. 2.0.5.1. However, I received the same exception if I used ExcelRW ver. 2.0.5.43. > >Thanks > > >>Hi, >> >>I tried to reproduce the problem using this sample with the code snippet that you had provided but it seems to work fine for me. >> >>F20341DeleteWorksheet_5280.zip >> >>Please take a look at the attached sample and let me know if you see the problem in this sample also. >> >>Could you please confirm the version of ExcelRW since the latest version available for download is version 2.1.0.9 and we did not have the version number that you have specified. >> >> >>One other thing you can look for is to make sure that the spelling of sheet1 is case sentitive it should be ''Sheet1'' and not ''sheet1''. >>Thanks. >> >>Best regards, >> >>Stephen. >>>Thanks for the quick reply. >>> >>>Belows are the code that I used for testing the Remove method: >>> >>>public void TestWorkBook () >>>{ >>>// Create a workbook with 2 worksheets >>>IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(2); >>> >>>// Delete the first worksheet >>>// I received exception as soon as I call the Remove method >>>myWorkBook.WorkSheets.Remove("Sheet1"); >>>} >>> >>>My ExcelRW version number is 1.1.4322 >>> >>>Thanks again. >>> >>> >>>>Hi, >>>> >>>>Could you please post your sample or the code snippet that you are using and also the version of ExcelRW that you are using. Thanks. >>>> >>>>Best regards, >>>> >>>>Stephen. >>>> >>>> >>>>>Hi, >>>>> >>>>>I received a System.NullReferenceException from the excelrw.dll when I called myWorkBook.Worksheets.Remove("Sheet1"). I checked the active workbook and confirmed it has the worksheet - "Sheet1". >>>>> >>>>>Any ideas or suggestions? >>>>> >>>>>Thanks in advance. >> >> >> >>

Loader.
Live Chat Icon For mobile
Up arrow icon