There are a couple of ways to execute Excel from Delphi. Here's one way: (the excelapp.Run('MacroName') is the command to run a macro). excelapp and excelsht are declared as variants.
excelapp:= CreateOleObject('Excel.Application');
excelapp.Visible := False;
excelapp.Workbooks.Open('O:\JMS\ProofHours.xls');
excelsht := excelapp.WorkSheets.Item['Data'];
excelsht.Activate;
excelsht.Range[excelsht.Cells.Item[2, 1], excelsht.Cells.Item[(personcount + 1), 5]].Value := ProcessList;
excelapp.Run('Process_Report');
Sleep(2000);
excelapp.Worksheets.Item['Report1'].printout;
excelapp.displayalerts := False;
excelapp.quit;
Good luck!
Leslie
landrews@metrocourt.state.nm.us
There are 10 types of people in the world -
those who understand binary
and
those who don't!