#INCLUDE XL97Cons.h * * Create the Excel file and SaveAs a Lotus 1-2-3 file * select TimeCard_V2 locate local lnRow, ox, lcFileName, ldLeaveDate, lnEmpID, lnRetval, lcLocalDrive lcLocalDrive = sys(5) + sys(2003) lcFileName = alltrim(substr(LastName, 1, 8)) ox = newobject('excel.application') ox.workbooks.add lnRow = 1 ox.sheets(1).cells(lnRow, 1) = FirstName This.mSetFont(ox.sheets(1).cells(lnRow, 1)) ox.sheets(1).cells(lnRow, 2) = LastName This.mSetFont(ox.sheets(1).cells(lnRow, 2)) lnRow = 3 ox.sheets(1).cells(lnRow, 1) = "Date" This.mSetFont(ox.sheets(1).cells(lnRow, 1)) ox.sheets(1).cells(lnRow, 2) = "Time In" This.mSetFont(ox.sheets(1).cells(lnRow, 2)) ox.sheets(1).cells(lnRow, 3) = "Time Out" This.mSetFont(ox.sheets(1).cells(lnRow, 3)) ox.sheets(1).cells(lnRow, 4) = "Lunch" This.mSetFont(ox.sheets(1).cells(lnRow, 4)) ox.sheets(1).cells(lnRow, 5) = "Net Hours" This.mSetFont(ox.sheets(1).cells(lnRow, 5)) ox.sheets(1).cells(lnRow, 6) = "Accrued" This.mSetFont(ox.sheets(1).cells(lnRow, 6)) ox.sheets(1).cells(lnRow, 7) = "Used" This.mSetFont(ox.sheets(1).cells(lnRow, 7)) ox.sheets(1).cells(lnRow, 8) = "Other Leave" This.mSetFont(ox.sheets(1).cells(lnRow, 8)) lnRow = 4 scan ox.sheets(1).cells(lnRow, 1) = Date_In ox.sheets(1).cells(lnRow, 2) = This.mGetTime(Time_In, AmPm_In) ox.sheets(1).cells(lnRow, 3) = This.mGetTime(Time_Out, AmPm_Out) ox.sheets(1).cells(lnRow, 4) = Lunch_Dur This.mFormatDecimals(ox.sheets(1).cells(lnRow, 4), 2) ox.sheets(1).cells(lnRow, 5) = Net_Hours This.mFormatDecimals(ox.sheets(1).cells(lnRow, 5), 2) ox.sheets(1).cells(lnRow, 6) = Accrued This.mFormatDecimals(ox.sheets(1).cells(lnRow, 6), 2) lnEmpID = Employee.KeyID ldLeaveDate = Date_In select Leave_V2 requery("Leave_V2") locate do while !eof() lnRow = lnRow + 1 ox.sheets(1).cells(lnRow, 1) = ldLeaveDate ox.sheets(1).cells(lnRow, 7) = CompUsed This.mFormatDecimals(ox.sheets(1).cells(lnRow, 7), 2) ox.sheets(1).cells(lnRow, 8) = OtherUsed This.mFormatDecimals(ox.sheets(1).cells(lnRow, 8), 2) skip enddo select TimeCard_V2 lnRow = lnRow + 1 endscan lnRow = lnRow + 2 ox.sheets(1).cells(lnRow, 1) = "Credit Balance" ox.sheets(1).cells(lnRow, 2) = str(Employee.Balance, 5, 2) ox.sheets(1).cells(lnRow, 3) = "As Of" ox.sheets(1).cells(lnRow, 4) = Employee.BalDate This.mFormatDecimals(ox.sheets(1).cells(lnRow, 2), 2) if file(addbs(lcLocalDrive) + lcFileName + ".xls") erase addbs(lcLocalDrive) + lcFileName + ".xls" endif if file(addbs(lcLocalDrive) + lcFileName + ".wk4") erase addbs(lcLocalDrive) + lcFileName + ".wk4" endif ox.activeworkbook.saveas(addbs(lcLocalDrive) + lcFileName + ".wk4", xlWK4, .F.) ox.activeworkbook.saveas(addbs(lcLocalDrive) + lcFileName + ".xls", xlNormal) ox.quit ox = .null. release ox return addbs(lcLocalDrive) + lcFileName procedure mSetFont * lparameter loCell With loCell.Font .Name = "Arial" .FontStyle = "Bold" .Size = 10 endwith return Procedure mTimeFormat * lparameter loCell loCell.NumberFormat = "h:mm" return Procedure mFormatDecimals * lparameter loCell, lnDecimals if pcount() < 1 or type("lnDecimals") <> "N" lnDecimals = 2 endif local lcMask lcMask = "0." + replicate("0", lnDecimals) loCell.NumberFormat = lcMask return