Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: John Cruz
  Where is John Cruz?
 NY
 New York - United States
 John Cruz
 Tags
Subject: Not release excel.exe from memory, HELP please.
Thread ID: 21795 Message ID: 21795 # Views: 32 # Ratings: 0
Version: Visual FoxPro 6 Category: Microsoft Office Automation
Date: Tuesday, April 01, 2003 10:12:13 PM         
   


Hi, hoping someone could help. I am running a VFP 6.0 prg retrieving data from an excel spreadsheet but it is not releasing from memory. due to many .xls worksheets I have to open my machine's memory is fulling up. Here is a copy of what I'm doing any suggestions could help. thanks again.

txtfile='d:\1234.xls'
set step on
passwrd = "1234"
loexcel=CREATEOBJECT("Excel.application")
loexcel.workbooks.open(txtfile,,,,passwrd)
********
* Error catching - Turn off FoxPro's error trapping
err=.f.
ON ERROR err=.t.
loExcel.Sheets("APR").Select
IF !err
lcquarter=1
ENDIF
ON ERROR && Reset error trapping
Release loexcel && Release Excel
********

loexcel.ActiveWorkbook.Close **here I'm getting an error as if this object does not exsist
loexcel.Application.Quit **here I'm getting an error as if this object does not exsist
loexcel=.NULL.
RELEASE loexcel

** By this point the program ends but it still shows Excel.exe in the task mananger... How can I clear this from memory?

COMPLETE THREAD

Not release excel.exe from memory, HELP please. Posted by John Cruz @ 4/1/2003 10:12:13 PM
RE: Not release excel.exe from memory, HELP ple... Posted by Dale Dedoroy @ 4/1/2003 10:49:58 PM
RE: Not release excel.exe from memory, HELP ple... Posted by John Cruz @ 4/2/2003 12:19:13 AM
RE: Not release excel.exe from memory, HELP ple... Posted by Ken Blum @ 4/2/2003 5:11:10 PM