Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft Excel is present?
Message
 
À
12/01/2001 20:40:22
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00463215
Message ID:
00463454
Vues:
13
ANother trick
**********
oldOnError=on('error')
on Error oExcel=.NULL.
oExcel=createobject('Excel.Application')
on error &oldOnError
if oExcel=.NULL.
* You got an error
Endif
*******************



>>>Hi,
>>> I need to check if Microsoft Excel is installed for use this:
>>>
>>>this.oExcelSession = CreateObject("Excel.Application")
>>>
>>> If it's not installed I get an error message.
>>>
>>>T.I.A.
>>You might use an ON ERROR handler that checks for a 1429 Error (i think). You'd have to work out the isolation routines to assure that the attempted instanciation was the culprit (like lineno or program()). Evaluate Ko's suggestion too.
>
>I believe the error returned would be 'Class definition not found' (1733) if Excel is not present. 1429 would only be returned from the oleserver after it had been sucessfully instantiated.
>
>Jon
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform