Page 1 of 1

Illegal ptgs

Posted: Wed Nov 15, 2017 9:20 am
by bturcs
I'm deleting rows in an XLS (old format) document containing a lot of internal names. It does work sometimes, later I'm getting the following exception:

Code: Select all

  XLSRWException: Illegal ptgs
  [00EF6DCF] XLSFormula5.TXLSIteratePtgs.Next$qqrv (Zeile 159, "XLSFormula5.pas")
  [00EF7C77] XLSFormula5.TXLSFormulaHandler.AdjustCellRowsChanged$qqrxp25Xlsformulatypes5.TXLSPtgsxixixixi (Zeile 527, "XLSFormula5.pas")
  [00FF2030] XLSSheetData5.TXLSWorksheet.AdjustRowsFormulas$qqrxixi (Zeile 1489, "XLSSheetData5.pas")
  [00FF4E35] XLSSheetData5.TXLSWorksheet.DeleteRows$qqrxixi (Zeile 2503, "XLSSheetData5.pas")
  [00FFBEB4] XLSSheetData5.TXLSWorkbook.DeleteRows$qqrxixixi (Zeile 5159, "XLSSheetData5.pas")
Can't post my current delphi code (sorry), but I could try to create a working example.

Re: Illegal ptgs

Posted: Wed Nov 15, 2017 10:16 am
by bturcs
Example to reproduce the bug:

Code: Select all

unit Unit3;

interface

procedure testn();

implementation

uses XLsReadWriteII5, SysUtils;

var
  _xls: TXlsReadWriteII5;

procedure AddInternalName(Name, Def: string);
begin
  _xls.Names.Add(Name, Def, 0);
end;

procedure DeleteRow(Sheet, RowStart, RowEnd: Integer);
begin
  _xls.DeleteRows(sheet, rowstart, rowend);
end;

procedure testn();
begin
  _xls := TXlsReadWriteII5.Create(nil);
  try
    _xls.Sheets[0].Name := 'Tabelle1';
    AddInternalName('TABELLE.2.', 'Tabelle1!$A$18:$J$20');
    AddInternalName('DATEN.1.ID_DEMO_2', 'Tabelle1!$A$17:$J$21');
    AddInternalName('TABELLE.3.', 'Tabelle1!$A$34:$J$36');
    AddInternalName('DATEN.2.ID_DEMO_3', 'Tabelle1!$A$31:$J$38');
    AddInternalName('TABELLE.4.', 'Tabelle1!$A$42:$J$44');
    AddInternalName('DATEN.3.ID_DEMO_4', 'Tabelle1!$A$39:$J$46');
    AddInternalName('TABELLE.5.', 'Tabelle1!$A$50:$J$52');
    AddInternalName('DATEN.4.ID_DEMO_5', 'Tabelle1!$A$47:$J$54');
    AddInternalName('TABELLE.6.', 'Tabelle1!$A$58:$J$60');
    AddInternalName('DATEN.5.ID_DEMO_6', 'Tabelle1!$A$55:$J$61');
    AddInternalName('TABELLE.7.', 'Tabelle1!$A$68:$J$70');
    AddInternalName('DATEN.6.ID_DEMO_7', 'Tabelle1!$A$65:$J$72');
    AddInternalName('TABELLE.8.', 'Tabelle1!$A$76:$J$78');
    AddInternalName('DATEN.7.ID_DEMO_8', 'Tabelle1!$A$73:$J$80');
    AddInternalName('TABELLE.9.', 'Tabelle1!$A$88:$J$90');
    AddInternalName('DATEN.9.ID_DEMO_9', 'Tabelle1!$A$85:$J$93');
    AddInternalName('TABELLE.10.', 'Tabelle1!$A$100:$J$102');
    AddInternalName('GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12', 'Tabelle1!$A$98:$J$103');
    AddInternalName('DATEN.10.ID_DEMO_13', 'Tabelle1!$A$94:$J$106');
    AddInternalName('TABELLE.11.', 'Tabelle1!$A$111:$J$113');
    AddInternalName('DATEN.11.ID_DEMO_14', 'Tabelle1!$A$108:$J$116');
    AddInternalName('TABELLE.12.', 'Tabelle1!$A$122:$J$124');
    AddInternalName('GRUPPE.3.ID_DEMO_15,FACH', 'Tabelle1!$A$120:$J$126');
    AddInternalName('DATEN.12.ID_DEMO_16', 'Tabelle1!$A$117:$J$128');
    AddInternalName('TABELLE.13.', 'Tabelle1!$A$132:$J$134');
    AddInternalName('DATEN.13.ID_DEMO_17', 'Tabelle1!$A$129:$J$137');
    AddInternalName('TABELLE.14.', 'Tabelle1!$A$142:$J$144');
    AddInternalName('GRUPPE.4..ID_DEMO_19', 'Tabelle1!$A$139:$J$148');
    AddInternalName('DATEN.14.FEHLZEIT', 'Tabelle1!$A$138:$J$149');
    AddInternalName('GRUPPE.1.ID_DEMO_1', 'Tabelle1!$A$82:$J$150');
    AddInternalName('DATEN.8.ID_DEMO_20', 'Tabelle1!$A$81:$J$151');
    AddInternalName('TABELLE.1.', 'Tabelle1!$A$7:$J$152');
    AddInternalName('ROOT', 'Tabelle1!$A$1:$J$152');
    AddInternalName('ROOT.1', 'Tabelle1!$A$1:$IV$152');
    AddInternalName('ROOT.1/TABELLE.1.', 'Tabelle1!$A$7:$IV$152');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.1.ID_DEMO_2', 'Tabelle1!$A$17:$IV$21');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.1.ID_DEMO_2.0/TABELLE.2.', 'Tabelle1!$A$18:$IV$20');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.2.ID_DEMO_3', 'Tabelle1!$A$31:$IV$38');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.2.ID_DEMO_3.0/TABELLE.3.', 'Tabelle1!$A$34:$IV$36');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.3.ID_DEMO_4', 'Tabelle1!$A$39:$IV$46');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.3.ID_DEMO_4.0/TABELLE.4.', 'Tabelle1!$A$42:$IV$44');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.4.ID_DEMO_5', 'Tabelle1!$A$47:$IV$54');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.4.ID_DEMO_5.0/TABELLE.5.', 'Tabelle1!$A$50:$IV$52');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.5.ID_DEMO_6', 'Tabelle1!$A$55:$IV$61');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.5.ID_DEMO_6.0/TABELLE.6.', 'Tabelle1!$A$58:$IV$60');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.6.ID_DEMO_7', 'Tabelle1!$A$65:$IV$72');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.6.ID_DEMO_7.0/TABELLE.7.', 'Tabelle1!$A$68:$IV$70');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.7.ID_DEMO_8', 'Tabelle1!$A$73:$IV$80');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.7.ID_DEMO_8.0/TABELLE.8.', 'Tabelle1!$A$76:$IV$78');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20', 'Tabelle1!$A$81:$IV$151');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1', 'Tabelle1!$A$82:$IV$150');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9',
      'Tabelle1!$A$85:$IV$93');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9.0/TABELLE.9.',
      'Tabelle1!$A$88:$IV$90');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13',
      'Tabelle1!$A$94:$IV$106');
    AddInternalName
      ('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12',
      'Tabelle1!$A$98:$IV$103');
    AddInternalName
      ('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12.0/TABELLE.10.',
      'Tabelle1!$A$100:$IV$102');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.11.ID_DEMO_14',
      'Tabelle1!$A$108:$IV$116');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.11.ID_DEMO_14.0/TABELLE.11.',
      'Tabelle1!$A$111:$IV$113');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16',
      'Tabelle1!$A$117:$IV$128');
    AddInternalName
      ('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH',
      'Tabelle1!$A$120:$IV$126');
    AddInternalName
      ('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH.0/TABELLE.12.',
      'Tabelle1!$A$122:$IV$124');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.13.ID_DEMO_17',
      'Tabelle1!$A$129:$IV$137');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.13.ID_DEMO_17.0/TABELLE.13.',
      'Tabelle1!$A$132:$IV$134');
    AddInternalName('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT',
      'Tabelle1!$A$138:$IV$149');
    AddInternalName
      ('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19',
      'Tabelle1!$A$139:$IV$148');
    AddInternalName
      ('ROOT.1/TABELLE.1..0/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19.0/TABELLE.14.',
      'Tabelle1!$A$142:$IV$144');
    AddInternalName('ROOT.1/TABELLE.1..1', 'Tabelle1!$A$8:$IV$151');
    AddInternalName('ROOT.1/TABELLE.1..2', 'Tabelle1!$A$152:$IV$295');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.1.ID_DEMO_2', 'Tabelle1!$A$17:$IV$21');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.1.ID_DEMO_2', 'Tabelle1!$A$161:$IV$165');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.1.ID_DEMO_2.0/TABELLE.2.', 'Tabelle1!$A$18:$IV$20');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.1.ID_DEMO_2/TABELLE.2.', 'Tabelle1!$A$162:$IV$164');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.2.ID_DEMO_3', 'Tabelle1!$A$31:$IV$38');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.2.ID_DEMO_3', 'Tabelle1!$A$175:$IV$182');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.2.ID_DEMO_3.0/TABELLE.3.', 'Tabelle1!$A$34:$IV$36');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.2.ID_DEMO_3/TABELLE.3.', 'Tabelle1!$A$178:$IV$180');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.3.ID_DEMO_4', 'Tabelle1!$A$39:$IV$46');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.3.ID_DEMO_4', 'Tabelle1!$A$183:$IV$190');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.3.ID_DEMO_4.0/TABELLE.4.', 'Tabelle1!$A$42:$IV$44');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.3.ID_DEMO_4/TABELLE.4.', 'Tabelle1!$A$186:$IV$188');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.4.ID_DEMO_5', 'Tabelle1!$A$47:$IV$54');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.4.ID_DEMO_5', 'Tabelle1!$A$191:$IV$198');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.4.ID_DEMO_5.0/TABELLE.5.', 'Tabelle1!$A$50:$IV$52');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.4.ID_DEMO_5/TABELLE.5.', 'Tabelle1!$A$194:$IV$196');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.5.ID_DEMO_6', 'Tabelle1!$A$55:$IV$61');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.5.ID_DEMO_6', 'Tabelle1!$A$199:$IV$205');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.5.ID_DEMO_6.0/TABELLE.6.', 'Tabelle1!$A$58:$IV$60');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.5.ID_DEMO_6/TABELLE.6.', 'Tabelle1!$A$202:$IV$204');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.6.ID_DEMO_7', 'Tabelle1!$A$65:$IV$72');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.6.ID_DEMO_7', 'Tabelle1!$A$209:$IV$216');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.6.ID_DEMO_7.0/TABELLE.7.', 'Tabelle1!$A$68:$IV$70');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.6.ID_DEMO_7/TABELLE.7.', 'Tabelle1!$A$212:$IV$214');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.7.ID_DEMO_8', 'Tabelle1!$A$73:$IV$80');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.7.ID_DEMO_8', 'Tabelle1!$A$217:$IV$224');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.7.ID_DEMO_8.0/TABELLE.8.', 'Tabelle1!$A$76:$IV$78');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.7.ID_DEMO_8/TABELLE.8.', 'Tabelle1!$A$220:$IV$222');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20', 'Tabelle1!$A$81:$IV$151');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20', 'Tabelle1!$A$225:$IV$295');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1', 'Tabelle1!$A$82:$IV$150');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1', 'Tabelle1!$A$226:$IV$294');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9',
      'Tabelle1!$A$85:$IV$93');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.9.ID_DEMO_9',
      'Tabelle1!$A$229:$IV$237');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9.0/TABELLE.9.',
      'Tabelle1!$A$88:$IV$90');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.9.ID_DEMO_9/TABELLE.9.',
      'Tabelle1!$A$232:$IV$234');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13',
      'Tabelle1!$A$94:$IV$106');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.10.ID_DEMO_13',
      'Tabelle1!$A$238:$IV$250');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12',
      'Tabelle1!$A$98:$IV$103');
    AddInternalName
      ('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.10.ID_DEMO_13/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12',
      'Tabelle1!$A$242:$IV$247');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12.0/TABELLE.10.',
      'Tabelle1!$A$100:$IV$102');
    AddInternalName
      ('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.10.ID_DEMO_13/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12/TABELLE.10.',
      'Tabelle1!$A$244:$IV$246');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.11.ID_DEMO_14',
      'Tabelle1!$A$108:$IV$116');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.11.ID_DEMO_14',
      'Tabelle1!$A$252:$IV$260');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.11.ID_DEMO_14.0/TABELLE.11.',
      'Tabelle1!$A$111:$IV$113');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.11.ID_DEMO_14/TABELLE.11.',
      'Tabelle1!$A$255:$IV$257');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16',
      'Tabelle1!$A$117:$IV$128');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.12.ID_DEMO_16',
      'Tabelle1!$A$261:$IV$272');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH',
      'Tabelle1!$A$120:$IV$126');
    AddInternalName
      ('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.12.ID_DEMO_16/GRUPPE.3.ID_DEMO_15,FACH',
      'Tabelle1!$A$264:$IV$270');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH.0/TABELLE.12.',
      'Tabelle1!$A$122:$IV$124');
    AddInternalName
      ('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.12.ID_DEMO_16/GRUPPE.3.ID_DEMO_15,FACH/TABELLE.12.',
      'Tabelle1!$A$266:$IV$268');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.13.ID_DEMO_17',
      'Tabelle1!$A$129:$IV$137');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.13.ID_DEMO_17',
      'Tabelle1!$A$273:$IV$281');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.13.ID_DEMO_17.0/TABELLE.13.',
      'Tabelle1!$A$132:$IV$134');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.13.ID_DEMO_17/TABELLE.13.',
      'Tabelle1!$A$276:$IV$278');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT',
      'Tabelle1!$A$138:$IV$149');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.14.FEHLZEIT',
      'Tabelle1!$A$282:$IV$293');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19',
      'Tabelle1!$A$139:$IV$148');
    AddInternalName('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.14.FEHLZEIT/GRUPPE.4..ID_DEMO_19',
      'Tabelle1!$A$283:$IV$292');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19.0/TABELLE.14.',
      'Tabelle1!$A$142:$IV$144');
    AddInternalName
      ('ROOT.1/TABELLE.1..2/DATEN.8.ID_DEMO_20/GRUPPE.1.ID_DEMO_1/DATEN.14.FEHLZEIT/GRUPPE.4..ID_DEMO_19/TABELLE.14.',
      'Tabelle1!$A$286:$IV$288');
    DeleteRow(0, 16, 20);
    DeleteRow(0, 25, 32);
    DeleteRow(0, 25, 32);
    DeleteRow(0, 25, 32);
    DeleteRow(0, 25, 31);
    DeleteRow(0, 28, 35);
    DeleteRow(0, 28, 35);
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1', 'Tabelle1!$A$30:$IV$98');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1', 'Tabelle1!$A$30:$IV$98');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9',
      'Tabelle1!$A$33:$IV$41');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9.0/TABELLE.9.',
      'Tabelle1!$A$36:$IV$38');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13',
      'Tabelle1!$A$42:$IV$54');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12',
      'Tabelle1!$A$46:$IV$51');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12.0/TABELLE.10.',
      'Tabelle1!$A$48:$IV$50');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.11.ID_DEMO_14',
      'Tabelle1!$A$56:$IV$64');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.11.ID_DEMO_14.0/TABELLE.11.',
      'Tabelle1!$A$59:$IV$61');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16',
      'Tabelle1!$A$65:$IV$76');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH',
      'Tabelle1!$A$68:$IV$74');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH.0/TABELLE.12.',
      'Tabelle1!$A$70:$IV$72');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.13.ID_DEMO_17',
      'Tabelle1!$A$77:$IV$85');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.13.ID_DEMO_17.0/TABELLE.13.',
      'Tabelle1!$A$80:$IV$82');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT',
      'Tabelle1!$A$86:$IV$97');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19',
      'Tabelle1!$A$87:$IV$96');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.0/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19.0/TABELLE.14.',
      'Tabelle1!$A$90:$IV$92');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1', 'Tabelle1!$A$31:$IV$97');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2', 'Tabelle1!$A$98:$IV$164');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9',
      'Tabelle1!$A$33:$IV$41');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.9.ID_DEMO_9',
      'Tabelle1!$A$100:$IV$108');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.0/TABELLE.9.',
      'Tabelle1!$A$36:$IV$38');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.9.ID_DEMO_9/TABELLE.9.',
      'Tabelle1!$A$103:$IV$105');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.10.ID_DEMO_13',
      'Tabelle1!$A$42:$IV$54');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.10.ID_DEMO_13',
      'Tabelle1!$A$109:$IV$121');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12',
      'Tabelle1!$A$46:$IV$51');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.10.ID_DEMO_13/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12',
      'Tabelle1!$A$113:$IV$118');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.10.ID_DEMO_13.0/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12.0/TABELLE.10.',
      'Tabelle1!$A$48:$IV$50');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.10.ID_DEMO_13/GRUPPE.2.ID_DEMO_10,ID_DEMO_11,ID_DEMO_12/TABELLE.10.',
      'Tabelle1!$A$115:$IV$117');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.11.ID_DEMO_14',
      'Tabelle1!$A$56:$IV$64');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.11.ID_DEMO_14',
      'Tabelle1!$A$123:$IV$131');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.11.ID_DEMO_14.0/TABELLE.11.',
      'Tabelle1!$A$59:$IV$61');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.11.ID_DEMO_14/TABELLE.11.',
      'Tabelle1!$A$126:$IV$128');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.12.ID_DEMO_16',
      'Tabelle1!$A$65:$IV$76');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.12.ID_DEMO_16',
      'Tabelle1!$A$132:$IV$143');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH',
      'Tabelle1!$A$68:$IV$74');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.12.ID_DEMO_16/GRUPPE.3.ID_DEMO_15,FACH',
      'Tabelle1!$A$135:$IV$141');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.12.ID_DEMO_16.0/GRUPPE.3.ID_DEMO_15,FACH.0/TABELLE.12.',
      'Tabelle1!$A$70:$IV$72');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.12.ID_DEMO_16/GRUPPE.3.ID_DEMO_15,FACH/TABELLE.12.',
      'Tabelle1!$A$137:$IV$139');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.13.ID_DEMO_17',
      'Tabelle1!$A$77:$IV$85');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.13.ID_DEMO_17',
      'Tabelle1!$A$144:$IV$152');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.13.ID_DEMO_17.0/TABELLE.13.',
      'Tabelle1!$A$80:$IV$82');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.13.ID_DEMO_17/TABELLE.13.',
      'Tabelle1!$A$147:$IV$149');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.14.FEHLZEIT',
      'Tabelle1!$A$86:$IV$97');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.14.FEHLZEIT',
      'Tabelle1!$A$153:$IV$164');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19',
      'Tabelle1!$A$87:$IV$96');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.14.FEHLZEIT/GRUPPE.4..ID_DEMO_19',
      'Tabelle1!$A$154:$IV$163');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.14.FEHLZEIT.0/GRUPPE.4..ID_DEMO_19.0/TABELLE.14.',
      'Tabelle1!$A$90:$IV$92');
    AddInternalName
      ('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.2/DATEN.14.FEHLZEIT/GRUPPE.4..ID_DEMO_19/TABELLE.14.',
      'Tabelle1!$A$157:$IV$159');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1',
      'Tabelle1!$A$34:$IV$40');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1/TABELLE.9.',
      'Tabelle1!$A$36:$IV$38');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1/TABELLE.9..1',
      'Tabelle1!$A$37:$IV$37');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1/TABELLE.9..2',
      'Tabelle1!$A$38:$IV$38');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1/TABELLE.9..3',
      'Tabelle1!$A$39:$IV$39');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1/TABELLE.9..4',
      'Tabelle1!$A$40:$IV$40');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1/TABELLE.9..5',
      'Tabelle1!$A$41:$IV$41');
    AddInternalName('ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.1/GRUPPE.1.ID_DEMO_1.1/DATEN.9.ID_DEMO_9.1/TABELLE.9..6',
      'Tabelle1!$A$42:$IV$42');
    DeleteRow(0, 41, 41);
    DeleteRow(0, 35, 35);
    DeleteRow(0, 40, 40);
    DeleteRow(0, 43, 55);
    DeleteRow(0, 44, 52);
    DeleteRow(0, 44, 55);
    DeleteRow(0, 44, 52);
    DeleteRow(0, 44, 55);
    DeleteRow(0, 32, 32);
    DeleteRow(0, 41, 41);
    DeleteRow(0, 42, 108);
    DeleteRow(0, 28, 28);
  finally
    freeAndNil(_xls);
  end;
end;

end.

Re: Illegal ptgs

Posted: Thu Nov 16, 2017 8:44 am
by larsa
Hello

You can't have names like: 'ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9'
If you try to create such a name in Excel you will get an error.

Re: Illegal ptgs

Posted: Thu Nov 16, 2017 9:12 am
by bturcs
If I use

Code: Select all

ROOT.1§TABELLE.1..1§DATEN.8.ID_DEMO_20.1§GRUPPE.1.ID_DEMO_1.1§DATEN.9.ID_DEMO_9.1§TABELLE.9..4
(replacing all '/' with '§') in the example, I still get the exception. Excel does not complain about the name.
Any other rules? And why worked it with XLSSUIT4?

thx,
Basti

Re: Illegal ptgs

Posted: Mon Nov 20, 2017 3:37 pm
by bturcs
larsa wrote: You can't have names like: 'ROOT.1/TABELLE.1..1/DATEN.8.ID_DEMO_20.0/GRUPPE.1.ID_DEMO_1.0/DATEN.9.ID_DEMO_9'
If you try to create such a name in Excel you will get an error.
I'm almost sure that the problem is not with the names. What can we do about this issue? Are there limits on the number of internal names? Or do I have to call some recalulate methods after the delete to update the document model?

Here is a version which does the same thing, but has very simple names like A1, A3, A123. The exception occurs as well:

Code: Select all

unit Unit3;

interface

procedure testn();

implementation

{$IFDEF XLSSUIT6}

uses XLsReadWriteII5, SysUtils;

type

  TXls = TXlsReadWriteII5;

{$ELSE}

uses XLSNames4, XLsReadWriteII4, SysUtils;

type

  TXls = TXlsReadWriteII4;

  {$ENDIF}

var
  _xls: TXls;

procedure AddInternalName(Name, Def: string);

{$IFNDEF XLSSUIT6}

var
  LNAme: TInternalName;

  {$ENDIF}

begin

  {$IFDEF XLSSUIT6}

  _xls.Names.Add(Name, Def, 0);

  {$ELSE}

  LNAme := _xls.InternalNames.Add;
  LNAme.Name := Name;
  LNAme.Definition := Def;

  {$ENDIF}

end;

procedure DeleteRow(Sheet, RowStart, RowEnd: Integer);
begin
  _xls.DeleteRows(Sheet, RowStart, RowEnd);
end;

procedure testn();
var i,j: Integer;
begin
  _xls := TXls.Create(nil);
  try
    _xls.Sheets[0].Name := 'Tabelle1';
    _c := 0;

    for I := 0 to 210 do
      for J := 0 to 210 do
        _Xls.Sheets[0].AsString[i,j] := IntToStr(i) + ',' + IntToStr(j);

    AddInternalName('A1 ', 'Tabelle1!$A$18:$J$20');
    AddInternalName('A2 ', 'Tabelle1!$A$17:$J$21');
    AddInternalName('A3 ', 'Tabelle1!$A$34:$J$36');
    AddInternalName('A4 ', 'Tabelle1!$A$31:$J$38');
    AddInternalName('A5 ', 'Tabelle1!$A$42:$J$44');
    AddInternalName('A6 ', 'Tabelle1!$A$39:$J$46');
    AddInternalName('A7 ', 'Tabelle1!$A$50:$J$52');
    AddInternalName('A8 ', 'Tabelle1!$A$47:$J$54');
    AddInternalName('A9 ', 'Tabelle1!$A$58:$J$60');
    AddInternalName('A10', 'Tabelle1!$A$55:$J$61');
    AddInternalName('A11', 'Tabelle1!$A$68:$J$70');
    AddInternalName('A12', 'Tabelle1!$A$65:$J$72');
    AddInternalName('A13', 'Tabelle1!$A$76:$J$78');
    AddInternalName('A14', 'Tabelle1!$A$73:$J$80');
    AddInternalName('A15', 'Tabelle1!$A$88:$J$90');
    AddInternalName('A16', 'Tabelle1!$A$85:$J$93');
    AddInternalName('A17', 'Tabelle1!$A$100:$J$102');
    AddInternalName('A18', 'Tabelle1!$A$98:$J$103');
    AddInternalName('A19', 'Tabelle1!$A$94:$J$106');
    AddInternalName('A20', 'Tabelle1!$A$111:$J$113');
    AddInternalName('A21', 'Tabelle1!$A$108:$J$116');
    AddInternalName('A22', 'Tabelle1!$A$122:$J$124');
    AddInternalName('A23', 'Tabelle1!$A$120:$J$126');
    AddInternalName('A24', 'Tabelle1!$A$117:$J$128');
    AddInternalName('A25', 'Tabelle1!$A$132:$J$134');
    AddInternalName('A26', 'Tabelle1!$A$129:$J$137');
    AddInternalName('A27', 'Tabelle1!$A$142:$J$144');
    AddInternalName('A28', 'Tabelle1!$A$139:$J$148');
    AddInternalName('A29', 'Tabelle1!$A$138:$J$149');
    AddInternalName('A30', 'Tabelle1!$A$82:$J$150');
    AddInternalName('A31', 'Tabelle1!$A$81:$J$151');
    AddInternalName('A32', 'Tabelle1!$A$7:$J$152');
    AddInternalName('A33', 'Tabelle1!$A$1:$J$152');
    AddInternalName('A34', 'Tabelle1!$A$1:$IV$152');
    AddInternalName('A35', 'Tabelle1!$A$7:$IV$152');
    AddInternalName('A36', 'Tabelle1!$A$17:$IV$21');
    AddInternalName('A37', 'Tabelle1!$A$18:$IV$20');
    AddInternalName('A38', 'Tabelle1!$A$31:$IV$38');
    AddInternalName('A39', 'Tabelle1!$A$34:$IV$36');
    AddInternalName('A40', 'Tabelle1!$A$39:$IV$46');
    AddInternalName('A41', 'Tabelle1!$A$42:$IV$44');
    AddInternalName('A42', 'Tabelle1!$A$47:$IV$54');
    AddInternalName('A43', 'Tabelle1!$A$50:$IV$52');
    AddInternalName('A44', 'Tabelle1!$A$55:$IV$61');
    AddInternalName('A45', 'Tabelle1!$A$58:$IV$60');
    AddInternalName('A46', 'Tabelle1!$A$65:$IV$72');
    AddInternalName('A47', 'Tabelle1!$A$68:$IV$70');
    AddInternalName('A48', 'Tabelle1!$A$73:$IV$80');
    AddInternalName('A49', 'Tabelle1!$A$76:$IV$78');
    AddInternalName('A50', 'Tabelle1!$A$81:$IV$151');
    AddInternalName('A51', 'Tabelle1!$A$82:$IV$150');
    AddInternalName('A52', 'Tabelle1!$A$85:$IV$93');
    AddInternalName('A53 ', 'Tabelle1!$A$88:$IV$90');
    AddInternalName('A54 ', 'Tabelle1!$A$94:$IV$106');
    AddInternalName('A55 ', 'Tabelle1!$A$98:$IV$103');
    AddInternalName('A56 ', 'Tabelle1!$A$100:$IV$102');
    AddInternalName('A57 ', 'Tabelle1!$A$108:$IV$116');
    AddInternalName('A58 ', 'Tabelle1!$A$111:$IV$113');
    AddInternalName('A59 ', 'Tabelle1!$A$117:$IV$128');
    AddInternalName('A60 ', 'Tabelle1!$A$120:$IV$126');
    AddInternalName('A61 ', 'Tabelle1!$A$122:$IV$124');
    AddInternalName('A62 ', 'Tabelle1!$A$129:$IV$137');
    AddInternalName('A63 ', 'Tabelle1!$A$132:$IV$134');
    AddInternalName('A64 ', 'Tabelle1!$A$138:$IV$149');
    AddInternalName('A65 ', 'Tabelle1!$A$139:$IV$148');
    AddInternalName('A66 ', 'Tabelle1!$A$142:$IV$144');
    AddInternalName('A67 ', 'Tabelle1!$A$8:$IV$151');
    AddInternalName('A68 ', 'Tabelle1!$A$152:$IV$295');
    AddInternalName('A69 ', 'Tabelle1!$A$17:$IV$21');
    AddInternalName('A70 ', 'Tabelle1!$A$161:$IV$165');
    AddInternalName('A71 ', 'Tabelle1!$A$18:$IV$20');
    AddInternalName('A72 ', 'Tabelle1!$A$162:$IV$164');
    AddInternalName('A73 ', 'Tabelle1!$A$31:$IV$38');
    AddInternalName('A74 ', 'Tabelle1!$A$175:$IV$182');
    AddInternalName('A75 ', 'Tabelle1!$A$34:$IV$36');
    AddInternalName('A76 ', 'Tabelle1!$A$178:$IV$180');
    AddInternalName('A77 ', 'Tabelle1!$A$39:$IV$46');
    AddInternalName('A78 ', 'Tabelle1!$A$183:$IV$190');
    AddInternalName('A79 ', 'Tabelle1!$A$42:$IV$44');
    AddInternalName('A80 ', 'Tabelle1!$A$186:$IV$188');
    AddInternalName('A81 ', 'Tabelle1!$A$47:$IV$54');
    AddInternalName('A82 ', 'Tabelle1!$A$191:$IV$198');
    AddInternalName('A83 ', 'Tabelle1!$A$50:$IV$52');
    AddInternalName('A84 ', 'Tabelle1!$A$194:$IV$196');
    AddInternalName('A85 ', 'Tabelle1!$A$55:$IV$61');
    AddInternalName('A86 ', 'Tabelle1!$A$199:$IV$205');
    AddInternalName('A87 ', 'Tabelle1!$A$58:$IV$60');
    AddInternalName('A88 ', 'Tabelle1!$A$202:$IV$204');
    AddInternalName('A89 ', 'Tabelle1!$A$65:$IV$72');
    AddInternalName('A90 ', 'Tabelle1!$A$209:$IV$216');
    AddInternalName('A91 ', 'Tabelle1!$A$68:$IV$70');
    AddInternalName('A92 ', 'Tabelle1!$A$212:$IV$214');
    AddInternalName('A93 ', 'Tabelle1!$A$73:$IV$80');
    AddInternalName('A94 ', 'Tabelle1!$A$217:$IV$224');
    AddInternalName('A95 ', 'Tabelle1!$A$76:$IV$78');
    AddInternalName('A96 ', 'Tabelle1!$A$220:$IV$222');
    AddInternalName('A97 ', 'Tabelle1!$A$81:$IV$151');
    AddInternalName('A98 ', 'Tabelle1!$A$225:$IV$295');
    AddInternalName('A99 ', 'Tabelle1!$A$82:$IV$150');
    AddInternalName('A100', 'Tabelle1!$A$226:$IV$294');
    AddInternalName('A101', 'Tabelle1!$A$85:$IV$93');
    AddInternalName('A102', 'Tabelle1!$A$229:$IV$237');
    AddInternalName('A103', 'Tabelle1!$A$88:$IV$90');
    AddInternalName('A104', 'Tabelle1!$A$232:$IV$234');
    AddInternalName('A105', 'Tabelle1!$A$94:$IV$106');
    AddInternalName('A106', 'Tabelle1!$A$238:$IV$250');
    AddInternalName('A107', 'Tabelle1!$A$98:$IV$103');
    AddInternalName('A108', 'Tabelle1!$A$242:$IV$247');
    AddInternalName('A109', 'Tabelle1!$A$100:$IV$102');
    AddInternalName('A110', 'Tabelle1!$A$244:$IV$246');
    AddInternalName('A111', 'Tabelle1!$A$108:$IV$116');
    AddInternalName('A112', 'Tabelle1!$A$252:$IV$260');
    AddInternalName('A113', 'Tabelle1!$A$111:$IV$113');
    AddInternalName('A114', 'Tabelle1!$A$255:$IV$257');
    AddInternalName('A115', 'Tabelle1!$A$117:$IV$128');
    AddInternalName('A116', 'Tabelle1!$A$261:$IV$272');
    AddInternalName('A117', 'Tabelle1!$A$120:$IV$126');
    AddInternalName('A118', 'Tabelle1!$A$264:$IV$270');
    AddInternalName('A119', 'Tabelle1!$A$122:$IV$124');
    AddInternalName('A120', 'Tabelle1!$A$266:$IV$268');
    AddInternalName('A121', 'Tabelle1!$A$129:$IV$137');
    AddInternalName('A122', 'Tabelle1!$A$273:$IV$281');
    AddInternalName('A123', 'Tabelle1!$A$132:$IV$134');
    AddInternalName('A124', 'Tabelle1!$A$276:$IV$278');
    AddInternalName('A125', 'Tabelle1!$A$138:$IV$149');
    AddInternalName('A126', 'Tabelle1!$A$282:$IV$293');
    AddInternalName('A127', 'Tabelle1!$A$139:$IV$148');
    AddInternalName('A128', 'Tabelle1!$A$283:$IV$292');
    AddInternalName('A129', 'Tabelle1!$A$142:$IV$144');
    AddInternalName('A130', 'Tabelle1!$A$286:$IV$288');
    DeleteRow(0, 16, 20);
    DeleteRow(0, 25, 32);
    DeleteRow(0, 25, 32);
    DeleteRow(0, 25, 32);
    DeleteRow(0, 25, 31);
    DeleteRow(0, 28, 35);
    DeleteRow(0, 28, 35);
    AddInternalName('A131', 'Tabelle1!$A$30:$IV$98');
    AddInternalName('A132', 'Tabelle1!$A$30:$IV$98');
    AddInternalName('A133', 'Tabelle1!$A$33:$IV$41');
    AddInternalName('A134', 'Tabelle1!$A$36:$IV$38');
    AddInternalName('A135', 'Tabelle1!$A$42:$IV$54');
    AddInternalName('A136', 'Tabelle1!$A$46:$IV$51');
    AddInternalName('A137', 'Tabelle1!$A$48:$IV$50');
    AddInternalName('A138', 'Tabelle1!$A$56:$IV$64');
    AddInternalName('A139', 'Tabelle1!$A$59:$IV$61');
    AddInternalName('A140', 'Tabelle1!$A$65:$IV$76');
    AddInternalName('A141', 'Tabelle1!$A$68:$IV$74');
    AddInternalName('A142', 'Tabelle1!$A$70:$IV$72');
    AddInternalName('A143', 'Tabelle1!$A$77:$IV$85');
    AddInternalName('A144', 'Tabelle1!$A$80:$IV$82');
    AddInternalName('A145', 'Tabelle1!$A$86:$IV$97');
    AddInternalName('A146', 'Tabelle1!$A$87:$IV$96');
    AddInternalName('A147', 'Tabelle1!$A$90:$IV$92');
    AddInternalName('A148', 'Tabelle1!$A$31:$IV$97');
    AddInternalName('A149', 'Tabelle1!$A$98:$IV$164');
    AddInternalName('A150', 'Tabelle1!$A$33:$IV$41');
    AddInternalName('A151', 'Tabelle1!$A$100:$IV$108');
    AddInternalName('A152', 'Tabelle1!$A$36:$IV$38');
    AddInternalName('A153', 'Tabelle1!$A$103:$IV$105');
    AddInternalName('A154', 'Tabelle1!$A$42:$IV$54');
    AddInternalName('A155', 'Tabelle1!$A$109:$IV$121');
    AddInternalName('A156', 'Tabelle1!$A$46:$IV$51');
    AddInternalName('A157', 'Tabelle1!$A$113:$IV$118');
    AddInternalName('A158', 'Tabelle1!$A$48:$IV$50');
    AddInternalName('A159', 'Tabelle1!$A$115:$IV$117');
    AddInternalName('A160', 'Tabelle1!$A$56:$IV$64');
    AddInternalName('A161', 'Tabelle1!$A$123:$IV$131');
    AddInternalName('A162', 'Tabelle1!$A$59:$IV$61');
    AddInternalName('A163', 'Tabelle1!$A$126:$IV$128');
    AddInternalName('A164', 'Tabelle1!$A$65:$IV$76');
    AddInternalName('A165', 'Tabelle1!$A$132:$IV$143');
    AddInternalName('A166', 'Tabelle1!$A$68:$IV$74');
    AddInternalName('A167', 'Tabelle1!$A$135:$IV$141');
    AddInternalName('A168', 'Tabelle1!$A$70:$IV$72');
    AddInternalName('A169', 'Tabelle1!$A$137:$IV$139');
    AddInternalName('A170', 'Tabelle1!$A$77:$IV$85');
    AddInternalName('A171', 'Tabelle1!$A$144:$IV$152');
    AddInternalName('A172', 'Tabelle1!$A$80:$IV$82');
    AddInternalName('A173', 'Tabelle1!$A$147:$IV$149');
    AddInternalName('A174', 'Tabelle1!$A$86:$IV$97');
    AddInternalName('A175', 'Tabelle1!$A$153:$IV$164');
    AddInternalName('A176', 'Tabelle1!$A$87:$IV$96');
    AddInternalName('A177', 'Tabelle1!$A$154:$IV$163');
    AddInternalName('A178', 'Tabelle1!$A$90:$IV$92');
    AddInternalName('A179', 'Tabelle1!$A$157:$IV$159');
    AddInternalName('A180', 'Tabelle1!$A$34:$IV$40');
    AddInternalName('A181', 'Tabelle1!$A$36:$IV$38');
    AddInternalName('A182', 'Tabelle1!$A$37:$IV$37');
    AddInternalName('A183', 'Tabelle1!$A$38:$IV$38');
    AddInternalName('A184', 'Tabelle1!$A$39:$IV$39');
    AddInternalName('A185', 'Tabelle1!$A$40:$IV$40');
    AddInternalName('A186', 'Tabelle1!$A$41:$IV$41');
    AddInternalName('A187', 'Tabelle1!$A$42:$IV$42');
    DeleteRow(0, 41, 41);
    DeleteRow(0, 35, 35);
    DeleteRow(0, 40, 40);
    DeleteRow(0, 43, 55);
    DeleteRow(0, 44, 52);
    DeleteRow(0, 44, 55);
    DeleteRow(0, 44, 52);
    DeleteRow(0, 44, 55);
    DeleteRow(0, 32, 32);
    DeleteRow(0, 41, 41);
    DeleteRow(0, 42, 108);
    DeleteRow(0, 28, 28);
  finally
    freeAndNil(_xls);
  end;
end;

end.

Re: Illegal ptgs

Posted: Wed Jan 17, 2018 9:09 am
by bturcs
I've isolated the problem and I think I can describe it: the problem is caused by deleting specific rows. After that, the corresponding ranges
are not updated correctly in TXLSFormulaHandler.AdjustCellRowsChanged.

Example:
  • define a named range: Tabelle1!$C$5:$C$10
  • call DeleteRows(0, 4, 6);
  • the named range is updated to Tabelle1!$C$2:$C$7
  • using XLSSUIT4, the named range is correctly updated to: Tabelle1!$C$5:$C$7
One can even render the document unusuable if you try to delete the range completely: the name becomes invalid and Excel is opening the file in protected-read-only mode.

I assume the same bug can occur if I delete columns with overlapping ranges or other kind of cell references. While I could fix this issue for myself (I changed the row calculation and the ptgs id in invalid cases), it would be very nice to get an update in which row-/column-deletion is fixed and the names (and all other references) are updated correctly in all combinations and for all kind of references.

Re: Illegal ptgs

Posted: Mon Jan 22, 2018 1:25 pm
by larsa
Hello

This is fixed in update 6.00.26

Re: Illegal ptgs

Posted: Wed Jan 24, 2018 2:52 pm
by bturcs
:P The exception is gone, thank you.