You are on page 1of 2

on run

tell application "Microsoft Excel"


activate
set origen to
"Serch:Users:sergiomonroylanderos:Desktop:CONAGUA
:CONAGUA.xlsx"
open origen
activate
tell worksheet "Comunicados" of active workbook
activate
copy value of cell "I14:I1000" to Estado
copy value of cell "J14:J1000" to Fecha_de_Comunicado
copy value of cell "O14:O1000" to Contratista
copy value of cell "W14:W1000" to I_Actualizado
end tell

tell worksheet "Facturas" of active workbook


activate
copy value of cell "F14:F2000" to Folio_Factura
copy value of cell "G14:G2000" to Fecha_De_Recepcion
copy value of cell "H14:H2000" to Tipo_de_Factura
copy value of cell "J14:J2000" to No_de_Estimacion
copy value of cell "L14:L2000" to Contratista_Factura
copy value of cell "O14:O2000" to M_Fac_S_Iva
end tell
end tell

(*display dialog Estado & Fecha_de_Comunicado & Contratista &


I_Actualizado*)
tell application "Microsoft Excel"
activate
set destino to
"Serch:Users:sergiomonroylanderos:Desktop:CONAGUA
:RESUMEN2.xlsx"
open destino
activate
set value of cell "B3:B1000" to Contratista
set value of cell "C3:C1000" to Estado
set value of cell "D3:D1000" to Fecha_de_Comunicado
set value of cell "E3:E1000" to I_Actualizado

set value of cell "G3:G2000" to Folio_Factura


set value of cell "H3:H2000" to Fecha_De_Recepcion
set value of cell "I3:I2000" to Tipo_de_Factura
set value of cell "J3:J2000" to No_de_Estimacion
set value of cell "K3:K2000" to Contratista_Factura
set value of cell "L3:L2000" to M_Fac_S_Iva

select range "A3:L3"


tell application "System Events"
tell process "Microsoft Excel"
key code {53} (* escape*)
keystroke "+" using control down
key code {52} (*enter*)
key code {53} (*escape*)
keystroke "s" using command down
delay 1
keystroke "w" using command down
end tell
end tell
end tell
end run

You might also like