Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test if Excel is installed
Message
 
 
À
14/02/2009 23:56:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01381728
Message ID:
01381851
Vues:
53
>Be carefull - you must quit successfully created Excel application. Or else it will stay in memory upon OS reload. For instance, I check Excel presence by such function :
>
>***************************************
>FUNCTION ExcelPresent
>***************************************
>TRY
> loz=CREATEOBJECT('excel.application')
> lcVersion=loz.Version
>CATCH
> lcVersion=''
>ENDTRY
>IF !EMPTY(lcVersion)
> loz.quit() && don't forget to do it
>ENDIF
>RETURN !EMPTY(lcVersion)

Hi Sergey,

I usually do it in a different way, like this
try
 ...
  
catch
  ...
finally

  if vartype(loExcel) = 'O'
    loExcel.Quit
   loExcel = null
   release loExcel
 endif
endtry
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform