Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel: check if invocation successful
Message
De
12/02/2015 17:03:41
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01615261
Message ID:
01615266
Vues:
35
>>
* If you do something like
>>
>>m.loExcel = CREATEOBJECT( "Excel.Application" )
>>
>>* can you then reliably check if it was instantiated successfully with
>>
>>IF TYPE( "m.loExcel" ) == "O" AND NOT ISNULL( m.loExcel )
>>  * Invocation successful
>>
>>
>>Related question - Excel 2007 is installed in the dev VM. For test purposes is there an easy way ( short of uninstalling the product ) to temporarily tweak Excel so it won't instantiate successfully?
>
>I prefer:
>
>TYPE([m.loExcel.Name])
>
>but this is just me :-)

Nice - thanks!

>About second question you can:
>
>m.loExcel = CREATEOBJECT( "Excel.Application" )
>
>Then just stop code and kill Excel with Task Manager or kill the Excel process with WMI.

Hmm, not sure if that properly simulates the case where Excel couldn't be properly instantiated in the CREATEOBJECT( ) call.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform