tmpsheet = GetObject('','excel.application') XLApp = tmpsheet.application XLApp.Visible = .t. XLApp.WorkBooks.Add() XLSheet = XLApp.ActiveSheet * Setting Page setup degan LETTER 8 1/2 X 11 inch LANDSCAPE * With xlsheet.PageSetup .LeftMargin = xlapp.InchesToPoints(0.0) .RightMargin = xlapp.InchesToPoints(0) .TopMargin = xlapp.InchesToPoints(0.25) .BottomMargin = xlapp.InchesToPoints(0.25) .Orientation = xlPortrait .PaperSize = xlPaperFanfoldUS EndWithI don't know if my code is wrong or I miss something, please advise.