@@ -1218,10 +1218,6 @@ private void AddPicture(string Name, ExcelPicture pic)
12181218 }
12191219 private void ValidatePictureFile ( string Name , FileInfo ImageFile )
12201220 {
1221- if ( Worksheet is ExcelChartsheet && _drawingsList . Count > 0 )
1222- {
1223- throw new InvalidOperationException ( "Chart worksheets can't have more than one drawing" ) ;
1224- }
12251221 if ( ImageFile == null )
12261222 {
12271223 throw ( new Exception ( "AddPicture: ImageFile can't be null" ) ) ;
@@ -1296,10 +1292,6 @@ public ExcelChart AddChartFromTemplate(Stream crtxStream, string name)
12961292 /// <returns>The new chart</returns>
12971293 public ExcelChart AddChartFromTemplate ( Stream crtxStream , string name , ExcelPivotTable pivotTableSource )
12981294 {
1299- if ( Worksheet is ExcelChartsheet && _drawingsList . Count > 0 )
1300- {
1301- throw new InvalidOperationException ( "Chart worksheets can't have more than one drawing" ) ;
1302- }
13031295 CrtxTemplateHelper . LoadCrtx ( crtxStream , out XmlDocument chartXml , out XmlDocument styleXml , out XmlDocument colorsXml , out ZipPackagePart themePart , "The crtx stream" ) ;
13041296 if ( chartXml == null )
13051297 {
@@ -1401,10 +1393,6 @@ public ExcelShape AddShape(string Name, eShapeStyle Style)
14011393 }
14021394 internal ExcelShape AddShape ( string Name , eShapeStyle Style , object container = null )
14031395 {
1404- if ( Worksheet is ExcelChartsheet && _drawingsList . Count > 0 )
1405- {
1406- throw new InvalidOperationException ( "Chart worksheets can't have more than one drawing" ) ;
1407- }
14081396 if ( _drawingNames . ContainsKey ( Name ) )
14091397 {
14101398 throw new Exception ( "Name already exists in the drawings collection" ) ;
@@ -1436,11 +1424,6 @@ internal ExcelShape AddShape(string Name, eShapeStyle Style, object container =
14361424 /// <returns>The slicer drawing</returns>
14371425 public ExcelTableSlicer AddTableSlicer ( ExcelTableColumn TableColumn )
14381426 {
1439- if ( Worksheet is ExcelChartsheet && _drawingsList . Count > 0 )
1440- {
1441- throw new InvalidOperationException ( "Chart worksheets can't have more than one drawing" ) ;
1442- }
1443-
14441427 if ( TableColumn . Table . AutoFilter . Columns [ TableColumn . Position ] == null )
14451428 {
14461429 TableColumn . Table . AutoFilter . Columns . AddValueFilterColumn ( TableColumn . Position ) ;
@@ -1464,10 +1447,6 @@ public ExcelTableSlicer AddTableSlicer(ExcelTableColumn TableColumn)
14641447 /// <returns>The slicer drawing</returns>
14651448 internal ExcelPivotTableSlicer AddPivotTableSlicer ( ExcelPivotTableField Field )
14661449 {
1467- if ( Worksheet is ExcelChartsheet && _drawingsList . Count > 0 )
1468- {
1469- throw new InvalidOperationException ( "Chart worksheets can't have more than one drawing" ) ;
1470- }
14711450 if ( ! string . IsNullOrEmpty ( Field . Cache . Formula ) )
14721451 {
14731452 throw new InvalidOperationException ( "Can't add a slicer to a calculated field" ) ;
@@ -1524,10 +1503,6 @@ internal ExcelPivotTableSlicer AddPivotTableSlicer(ExcelPivotTableField Field)
15241503 /// <returns>The shape object</returns>
15251504 public ExcelShape AddShape ( string Name , ExcelShape Source )
15261505 {
1527- if ( Worksheet is ExcelChartsheet && _drawingsList . Count > 0 )
1528- {
1529- throw new InvalidOperationException ( "Chart worksheets can't have more than one drawing" ) ;
1530- }
15311506 if ( _drawingNames . ContainsKey ( Name ) )
15321507 {
15331508 throw new Exception ( "Name already exists in the drawings collection" ) ;
@@ -1554,10 +1529,6 @@ public ExcelShape AddShape(string Name, ExcelShape Source)
15541529 /// <exception cref="ArgumentException">Drawing names must be unique</exception>
15551530 public ExcelControl AddControl ( string Name , eControlType ControlType )
15561531 {
1557- if ( Worksheet is ExcelChartsheet && _drawingsList . Count > 0 )
1558- {
1559- throw new InvalidOperationException ( "Chart worksheets can't have more than one drawing" ) ;
1560- }
15611532 if ( _drawingNames . ContainsKey ( Name ) )
15621533 {
15631534 throw new ArgumentException ( "Name already exists in the drawings collection" ) ;
0 commit comments