release oXLPage
Also, without seeing the actual code, I'm currious, the variable is called oXLPage, but what actual excel object is it? Application, workbook, sheet? I assume by the naming, that it's a sheet, well then is there also an application and workbook object that you have assigned to a variable out there somewhere? Could there theorhetically be Excel application objects out there that you did not explicitly create that continue to eat up memory? Perhaps try something like this & see what happens.LOCAL oExcel, oWorkbook, oSheet oExcel = createObject("Excel.Application") with oExcel .sheetsInNewWorkbook = 1 .displayAlerts = .f. oWorkbook = .workbooks.add() SELECT TheCursorWithTheDataInIt SCAN oSheet = oWorkbook.sheets.add() && DO WORK WITH oSheet HERE release oSheet ENDSCAN endwith with oWorkbook .saveas(whatever) .close() endwith oExcel.quit() release oSheet release oWorkbook release oExcel>Folks
>SELECT TheCursorWithTheDataInIt >SCAN > oXLPage = CREATEOBJECT("DoOnePageThingy", param1, param2 ...) >ENDSCAN >>
>SELECT TheCursorWithTheDataInIt >SCAN > = Do1Page(param1, param2 ...) >ENDSCAN > >PROC Do1Page >LPARAMETERS param1, param2 ... >* the var goes out of scope more explicitly here >LOCAL oXLPage >oXLPage = CREATEOBJECT("DoOnePageThingy", param1, param2 ...) >ENDPROC >>