>I have a form that uses Automation to create and format a large number of Excel 2000 spreadsheets. W98 clients hang after doing somewhere close to 100 xls files. NT workstation does not have this problem. I found a KB article (Q216400) suggesting that the program is exceeding the # of allowed COM interfaces requested at once (65k). Following the suggestions in the KB article produced no gain. Anyone else run up against this?
No, I've never run up against this problem, mostly because I can't imagine what the performance would be with 100 XLS files open. I did run across a problem in how many charts one could put into a workbook (which has been rectified) -- so I'd have to store the 60 or more charts in a series of XLS files. To acheive maximum performance, I shut each one down as I finished, before opening the next.
You don't need to do a series of CREATEOBJECT() calls. It should look something like:
oExcel = CreateObject("Excel.Application")
FOR I = 1 TO nHoweverManyWorkbooksYouNeed
oBook = oExcel.Workbooks.Add()
lSaveChanges = .T.
cFileName = "\mypath\myfile.xls"
oBook.Close(lSaveChanges, cFileName)
ENDFOR
This should save a lot on resources.
- della Martin