1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| ExcelApplication1.Connect;
ExcelApplication1.ReferenceStyle[xlR1C1];
MonClasseur := ExcelApplication1.Workbooks.Open('l:\classeur1.xls', False, False,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, 0);
ExcelApplication1.Visible[0] := true;
MaFeuille := MonClasseur.Worksheets[1] AS _worksheet;
cellDebut := 'L'+ IntToStr(PremiereLigne) + 'C' + IntToStr(ColonneTemps);
colFin := nbDataReal +ColonneTemps;
ligneFin := PremiereLigne +nbColonnesTotal;
cellFin := 'L'+ IntToStr(ligneFin-1) + 'C' + IntToStr(colFin);
cellDebut := 'D12';
cellFin := 'CT545';
Resultat := MaFeuille.Range[cellDebut, cellFin].Value;
FOR comptLig := 1 TO VarArrayHighBound(Resultat, 1) DO
FOR comptCol := 1 TO VarArrayHighBound(Resultat, 2) DO
begin
mesValeurs[comptlig,comptcol] := Resultat[comptlig, comptcol];
Resultat[comptlig, comptcol] := Resultat[comptlig, comptcol] * 3 + 2; end;
MaFeuille.Range[cellDebut, cellFin].Value := Resultat;
ExcelApplication1.disConnect; |