Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reporting using Excel, Excel remains open
Message
De
15/03/2003 05:49:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
13/03/2003 14:39:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00765514
Message ID:
00766148
Vues:
28
>>'Release' will only release the variable. It won't take XL out of memory, and it really isn't needed anyway if oleexcel is local. oleexcel.quit() is the way to go as Selim pointed out.
>
>also Selim is correct, and this is also the more correct way, realese oleexcel will terminate excel. try and watch the task manager:
>oleexcel = CREATEOBJECT("Excel.application")
>release oleexcel
>
>i would think that this would be equal to terminating the process in the task manager.

Gunnar,
With this simple 2 lines it might. However almost all the time when you have an execl object you do something with it like adding, opening a workbook. If you do then releasing doesn't remove excel instance :

oExcel = createobject('Excel.Application')
oExcel.Workbooks.Add
release oExcel

To my experience both a oExcel.quit and release of variable is required. Releasing the variable with code however might not be necessary. As routine ends variable goes out of scope implicitly (provided not public).
Interestingly (don't have demo code right now) sometimes it's necessary oExcel should be in scope till user really exists excel (sounds version based). This once hit me badly, my partner reporting a crash and I wasn't seeing it at all with same code. It turned out to be I was using menu to close a sheet and he was using 'Ctrl+F4' (VFP5 days - excel 97?).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform