Use customer Copy to customerxls type xls #include xlconstants.h oExcel=createobject('Excel.Application') With oExcel .Workbooks.Open(sys(5)+curdir()+'customerxls.xls') With .ActiveWorkBook.ActiveSheet .Range("A1").AutoFormat(xlRangeAutoFormatColor2) *!* *Format headers *!* .Cells(1,1).VALUE = "Customer Id" *!* * Format the data *!* .RANGE("1:1").FONT.Bold=.T. *!* .RANGE("L:L").NumberFormat = [_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)] *!* With .Range('A:A').Font *!* .Bold = .t. *!* .Size = 12 *!* .Color = rgb(255,0,0) *!* Endwith *!* With .Range('B:B').Font *!* .Bold = .t. *!* .Italic=.t. *!* .Size = 12 *!* .Color = rgb(0,0,255) *!* Endwith *!* With .Range('E:E').Font *!* .Bold = .t. *!* .Italic=.t. *!* .Size = 12 *!* Endwith *!* .Columns.Autofit .Range("A1").select Endwith .visible = .t. EndwithComment autoformat line and uncomment the commented to see custom formatting.