Clearing Worksheets Collection

0
After I create a Workbook object I immediately clear the worksheets to get rid of any default worksheets. Workbook.Worksheets.Clear() I then run my code that will add one or more new sheets. When I attempt to save my workbook I am getting the following error. I have played with ActiveSheets and ActiveSheetsIndex and it looks like even though I cleared my worksheets the Workbook still thinks the ActiveSheet is "Sheet1". I have tried calling SetActiveSheet after adding new woksheets with the same result. Is this a bug or something I am dpoing wrong? .NET Stack Trace: [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.Excel2007Serializator.SerializeWorksheet(XmlWriter writer, Worksheet sheet, Stream streamStart, Stream streamConFormats, Dictionary`2 hashXFIndexes) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.WorksheetDataHolder.SerializeWorksheetPart(Worksheet sheet, Dictionary`2 hashNewXFIndexes) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.WorksheetDataHolder.SerializeWorksheet(Worksheet sheet, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveWorksheet(Worksheet sheet, String itemName, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveSheet(BaseSheet sheet, String itemName, RelationCollection relations, String workbookPath, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveSheets(RelationCollection relations, String workbookItemName, Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveWorkbookPart(Dictionary`2 hashNewXFIndexes, Dictionary`2 cacheFiles) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveWorkbook(FileSaveType saveAsType) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveDocument(FileSaveType saveType) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveDocument(Stream stream, FileSaveType saveType) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.XmlSerialization.FileDataHolder.SaveDocument(String filename, FileSaveType saveType) [18/04/25@14:55:12.662-0400] P-007412 T-018456 1 4GL ORS_ERR at ComponentPro.Excel.Workbook.SaveAs(String FileName, FileSaveType saveType, ExcelVersion version)
 
asked 4/25/2018 6:58:28 PM
add a comment

3 Answers

0
I downloaded 7.0.21 and code that was working before no longer works. the following was being used to add a style. oStyle = poWorkbook.Styles.Add ("ORS_Date", poWorkbook.Styles [0] ). oStyle.NumberFormat = "mm/dd/yyyy". oStyle.HorizontalAlignment = ExcelHAlign.HAlignCenter. oStyle.WrapText = TRUE. oStyle.FONT.FontName = "Arial". oStyle.FONT.Bold = FALSE. oStyle.Font.Size = 10. As soon as I reference 'Font' I get the error System.MissingMethodException: Method 'ComponentPro.Excel.Style.get_Font' not found.
 
answered 5/3/2018 8:08:11 PM
  I actually get many errors that are similar. If I try to freeze panes I get the error; System.MissingMethodException: Method 'ComponentPro.Excel.Range.get_Item' not found. Any ideas? rblanchard66 5/4/2018 12:37:14 PM
  Can you please send an example project to support@componentpro.com? Our API is changed a bit in v7.0. sysadmin 5/5/2018 7:59:50 AM
  That issue is related to our obfuscator. I have sent you the new bin file. The release version wont have such issue. sysadmin 5/8/2018 4:05:58 PM
add a comment
0
Where do I get RC version 7.0?
 
answered 4/27/2018 6:42:31 PM
  Please download it from http://www.componentpro.com/temp/UltimateExcel_v7.0.21.zip sysadmin 5/1/2018 1:23:02 AM
add a comment
0
Please use our RC version 7.0 which we sent you in the email. That one addresses several issues related to sheet. Please let us know if you have any issues.
 
answered 4/26/2018 4:22:30 AM
  I am not sure I received any email about RC version 7.0. Is it possible to send again? My SPAM filter may have blocked it. Thank You. rblanchard66 4/26/2018 11:17:25 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged excel or ask your own question.