excelapp:= CreateOleObject('Excel.Application');
excelapp.Visible := False;
excelapp.Workbooks.Open('R:\Case Management\JMS\Forms\Vouchers.xls');
excelsht := excelapp.WorkSheets.Item['Data'];
excelsht.Activate;
//set excel range to size of ProcessList array and transfer array in full
excelsht.Range[excelsht.Cells.Item[2, 1], excelsht.Cells.Item[(personcount + 1), 8]].Value := ProcessList;
excelsht.Cells[1,10] := lastvoucher;
//run macro to process report
excelapp.Worksheets.Item['VoucherReport'].PageSetup.LeftFooter := 'Voucher Processing for term beginning: ' + frmMainMenu.ProcessDate;
excelapp.Run('Generate_VoucherRpt');
lastvoucher := excelsht.Cells[1, 10].Text;