v4 > v5 - DefaultSheetProtections and _Int_Records.PROTECT

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
pmal
Posts: 12
Joined: Fri Nov 13, 2009 8:01 am

v4 > v5 - DefaultSheetProtections and _Int_Records.PROTECT

Post 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
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: v4 > v5 - DefaultSheetProtections and _Int_Records.PROTECT

Post by larsa »

Hello

You don't have to set the default values. They are assigned by the TXLSSheetProtection object from start.
Lars Arvidsson, Axolot Data
Post Reply