Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I cannot close Excel.application
Message
From
14/05/2002 14:31:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
I cannot close Excel.application
Miscellaneous
Thread ID:
00656380
Message ID:
00656380
Views:
62
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
Map
View

Click here to load this message in the networking platform