lcPhotoPath = _samples+'\data\graphics\' Select last_name, first_name, title from employee into cursor crsEmp Copy to myEmployee type xls oExcel = createobject('Excel.Application') With oExcel .Workbooks.Open(sys(5)+curdir()+'myEmployee.xls') With .ActiveWorkbook.Activesheet .Cells(1,4).Value = 'Photo' Scan lcPhoto = lcPhotoPath+left(last_name,4)+left(first_name,4)+'.GIF' If file(lcPhoto) && Add photo if any .Range('D'+ltrim(str(recno()+1))).Select .Pictures.Insert(lcPhoto) Endif Endscan lnMaxWidth = 0 lnRatio = fontmetric(19,'Arial',11)/fontmetric(6,'Arial',11)/72 For each oShape in .Shapes oShape.LockAspectRatio = .T. oShape.Height = 72 lnMaxWidth = max(lnMaxWidth,oShape.Width) Endfor .Range('A2:D'+ltrim(str(reccount()+1))).RowHeight = 72 .Range('D:D').ColumnWidth = lnMaxWidth*lnRatio .Columns('A:C').VerticalAlignment = -4108 Endwith .Visible = .t. EndwithCetin