Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One more about excel object.
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00196217
Message ID:
00200128
Views:
26
If I run the following lines from the command window, the amount of available memory stays the same

MyExcel = CreateObject("Excel.Application")
MyExcel.WorkBooks.Add()
MyExcel.ActiveSheet.PageSetup.CenterHeader = "MY HEADER "
MyExcel.ActiveWorkBook.Close(.F.)
release MyExcel

But if I put these lines into a prg and run it, the available memory decreases every time.

Even more: if I run the program without the 3rd line (pagesetup.centerhead...), it works fine again. What am I missing there?



>>I´ve been working with an excel object, wich is filled with data and used to
>>print/save this data to a file. I use the close method of the excel object to
>>relase it (at least that´s what I think), but it seems to be eating the RAM.
>
>I'm pretty sure Nancy is right, you aren't releasing the excel objects as you go you're just creating new ones.
>
>I've just finished a pretty big Excel Automation project and here is what works for me.
>
>* m.oExcel is my excel object
>* cFileName is the file I'm saving to
>*
>m.oExcel.ActiveWorkbook.SaveAs(cFileName)
>m.oExcel.Quit
>release m.oExcel
>
>enjoy!
>
>scott
There´s a better life... Just it´s more expensive!
Cristóbal Manrique M.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform