>ctargetfile = "c:\client.xls" >EXPORT TO &ctargetfile TYPE XL5 FIELDS cusmas->cusno,cusmas->cusname >TRY >oExcel = CREATEOBJECT([Excel.Application]) >oWorkbook = oExcel.Workbooks.open(ctargetfile) >oExcel.Visible = .t. >WITH oExcel.activesheet > .PageSetup.Orientation = xlLandScape > .PageSetup.TopMargin =12 > .PageSetup.LeftMargin =20 > .PageSetup.BottomMargin =20 > .PageSetup.RightMargin =15 > .Range("A1").value = "Client Code" > .Range("B1").value = "Client Name" > .Range("1:1").font.bold = .t. >.... >ENDWITH >oWorkbooks.Save(ctargetfile) >oWorkbooks.Close >CATCH > MessageBox([There is no EXCEL installed]) >ENDTRY >oExcel.quit(0)