Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for Excel instance?
Message
De
21/02/2002 12:20:53
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00621712
Message ID:
00623238
Vues:
21
Borislav:

With Excel 2000 getobject will always create an instance of Excel <s>. So, it wont error, so, you can't trap for it because it wont error.

>OK try this:
>
>old_error = ON("ERROR")
>fl_error = .f.
>ON ERROR fl_error = .t.
>oExcel = GetObject(,"Word.Application")
>IF TYPE("oExcel") # "O" .OR. ISNULL(oExcel) .OR. fl_error
> oExcel = CreateObject("Excel.Application")
>ENDIF
>
>ON ERROR &old_error
-=Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform