Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test if Excel is installed
Message
 
 
To
14/02/2009 23:56:24
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01381728
Message ID:
01381851
Views:
54
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform