Vous êtes sur la page 1sur 1

AUTOMATIZACIN MICROSOFT EXCEL DESDE UNA CLASE

VISUAL FOXPRO
Autor Aldebarn

En este ejemplo veremos como podemos realizar clculos en Excel a travs de automatizacin.

oExcel = Createobject("Excel.Application")
With oExcel
.Visible=.T.
.Workbooks.Add
.ActiveWorkbook.Sheets(1).Activate
.Cells(3,2)
.Cells(4,2)
.Cells(5,2)
.Cells(6,2)
.Cells(7,2)

=
=
=
=
=

10
26
63
42
1

.Cells(9,1) = "Suma"
.Cells(9,2).FormulaR1C1 = "=SUM(R[-6]C:R[-1]C)"
.Cells(10,1) = "Promedio"
.Cells(10,2).FormulaR1C1 = "=AVERAGE(R[-7]C:R[-2]C)"
.Cells(11,1) = "Mximo"
.Cells(11,2).FormulaR1C1 = "=MAX(R[-8]C:R[-3]C)"
.Cells(12,1) = "Mnimo"
.Cells(12,2).FormulaR1C1 = "=MIN(R[-9]C:R[-4]C)"
EndWith

Vous aimerez peut-être aussi