General information
Category:
COM/DCOM and OLE Automation
Title:
I cannot close Excel.application
I need to send my DBFs to Excel spredasheet with full functionality. I use the same procedure. All but one work fine. This particular procedure sends 17000 records to Spreadsheet with 12 columns.
loExcel=CREATEOBJECT("Excel.Application")
WITH loExcel
.Workbooks.ADD
.RANGE("A1").VALUE="Date:"
..........................
.RANGE("L1").VALUE="...."
lnRow=2
SELECT TEMPRPT
SCAN
.Cells(lnRow,1).VALUE=TEMPRPT.Field1
....................................
.Cells(lnRow,12).VALUE=TEMPRPT.Field12
lnRow=lnRow+1
ENDSCAN
ENDWITH
loExcel.ActiveWorkbook.SaveAs(cName)
loExcel.ActiveWorkbook.Close
loExcel.Application.Quit
loExcel.Quit
loExcel=.NULL.
RELEASE loExcel
After executing of this procedure my XLS file is Ok, but EXCEL still open.
I tried it on Windows 98 and Windows ME. I have VFP5 and Office 2000.
I have only about 1700 records, but I need to create 12 columns in Excel spreadsheet. I think my problem relates somehow to the columns number, because when I tested my program and eliminated Columns numbet to 8, it worked perfect for the same amount of records. However, when I added 9th column, I got the same problem again.
I can see my open Excel in Task Meneger, and if I would like to continue, it freezes up my computer.
What's wrong?
Thanks,
Helen
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only