long ll_result
oleobject lole_excel
TRY
string ls_nuevo
ls_nuevo = Mid(spRuta, 1, Pos(spRuta, '.')) + "xls"
lole_excel = create oleobject
ll_result = lole_excel.ConnectToNewObject("Excel.Application")
lole_excel.WorkBooks.Open( spRuta )
lole_excel.DisplayAlerts = False
lole_excel.worksheets(1).Activate
// Insertar 3 lineas
lole_excel.ActiveWorkbook.Worksheets(1).Range("1:3").Select
lole_excel.ActiveWorkbook.Worksheets(1).Range("1:3").Insert
// Titulo
lole_excel.ActiveWorkbook.Worksheets(1).Range("A1").Select
lole_excel.Selection.Font.Bold = True
lole_excel.Selection.Font.Size = 14
lole_excel.ActiveCell.FormulaR1C1 = "Azteca Express"
// Fecha
lole_excel.ActiveWorkbook.Worksheets(1).Range("A2").Select
lole_excel.ActiveCell.FormulaR1C1 = "Date: " + String( today(), "mm/dd/yyyy" )
lole_excel.ActiveWorkbook.Worksheets(1).Range("A3").Select
lole_excel.ActiveCell.FormulaR1C1 = titulo
lole_excel.ActiveSheet.PageSetup.PrintTitleRows = "$1:$"+string(lineas_titulo)
if Upper(orientacion) = 'V' then
lole_excel.ActiveSheet.PageSetup.Orientation = 1
else
lole_excel.ActiveSheet.PageSetup.Orientation = 2
end if
lole_excel.ActiveSheet.PageSetup.Zoom = False
lole_excel.ActiveSheet.PageSetup.FitToPagesWide = 1
lole_excel.ActiveSheet.PageSetup.FitToPagesTall = 50
lole_excel.ActiveSheet.PageSetup.ScaleWithDocHeaderFooter = True
lole_excel.ActiveSheet.PageSetup.AlignMarginsHeaderFooter = True
lole_excel.ActiveWorkbook.SaveAs( ls_nuevo, 56 )
//FileDelete( spRuta )
lole_excel.windowstate = -4137
lole_excel.Application.Visible = true
lole_excel.DisconnectObject()
DESTROY lole_excel
CATCH (Oleruntimeerror ole_err)
SetPointer(Arrow!)
f_mensaje("A", ole_err.text)
//FINALLY
// lole_excel.Application.DisplayAlerts = False
// lole_excel.Application.Workbooks(1).Close()
// DESTROY lole_excel
END TRY