Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I cannot close Excel.application
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00656380
Message ID:
00656440
Views:
17
>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,

I don't know if this will help, but I ran into the problem of Excel not releasing during a FOR EACH oCell IN oRange...ENDFOR loop. See MSKB#Q279777. The only solution that I or MS found was to issue CLEAR ALL. It's one of the reasons I started using property (adding them) of the _VFP object. CLEAR ALL will release variables but not the properties associated with this or any other system variable.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform