Function SetPatternRange(sheet:variant;range:string;
Pattern,ColorIndex,PatternColorIndex,Color,PatternColor:integer):boolean;
begin
SetPatternRange:=true;
try
E.ActiveWorkbook.Sheets.Item[sheet].Range[range].Interior.Pattern:=Pattern;
if ColorIndex>0
then E.ActiveWorkbook.Sheets.Item[sheet].Range
[range].Interior.ColorIndex:=ColorIndex
else E.ActiveWorkbook.Sheets.Item[sheet].Range
[range].Interior.Color:=color;
if PatternColorIndex>0
then E.ActiveWorkbook.Sheets.Item[sheet].Range
[range].Interior.PatternColorIndex:=PatternColorIndex
else E.ActiveWorkbook.Sheets.Item[sheet].Range
[range].Interior.PatternColor:=PatternColor;
except
SetPatternRange:=false;
end;
End;
|