Page 1 of 1

v4 > v5 - DefaultSheetProtections and _Int_Records.PROTECT

Posted: Thu Aug 01, 2013 11:53 am
by pmal
Hello,

I testing XLSRW v.5 in our application (before buying upgrade from v.4).
Please help me. How rewrite this code in version 5

v4 - worked

Code: Select all

procedure RepairLockList;
  var
    K: Integer;
  begin
      with xlsReadWrite do
        for K:= 0 to Sheets.Count - 1 do
            Sheets[K].SheetProtection:= DefaultSheetProtections;
  end;

  procedure RepairUnLockList;
  var
    K: Integer;
  begin
      with xlsReadWrite do
        for K:= 0 to Sheets.Count - 1 do
          if Sheets[K]._Int_Records.PROTECT = 0 then
            Sheets[K].SheetProtection:= DefaultSheetProtections;
  end;
v5 - unknown properties or constants
- DefaultSheetProtections ?
- _Int_Records.PROTECT ?

Code: Select all

  procedure RepairLockList;
  var
    K: Integer;
  begin
    with xlsReadWrite do
      for K:= 0 to Count - 1 do
        Sheets[K].Protection:=  ?DefaultSheetProtections?;
  end;

  procedure RepairUnLockList;
  var
    K: Integer;
  begin
      with xlsReadWrite do
        for K:= 0 to Count - 1 do
          if Sheets[K].?_Int_Records.PROTECT? = 0 then
            Sheets[K].Protection:= ?DefaultSheetProtections?
  end;
Thanks for help! PMal

Re: v4 > v5 - DefaultSheetProtections and _Int_Records.PROTECT

Posted: Fri Aug 02, 2013 6:08 am
by larsa
Hello

You don't have to set the default values. They are assigned by the TXLSSheetProtection object from start.