Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Guideline for using foxobject in FOR EACH
Message
De
25/09/2019 13:24:35
 
 
À
25/09/2019 13:02:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01671042
Message ID:
01671124
Vues:
77
>Hi Thomas,
>
>Thanks for the explanation - now making sense to me. I am indeed now using createobject() to create an instance of an Excel/Word object (as per suggestion here by Cetin). For the most part, I have made this a global change in the app so that other processes launched do not clobber something already running.
>
>So to summarize what you have said, use DOEVENTS so that if a COM object is still working away at something, even when control is returned to VFP, DOEVENTS forces VFP to wait until the COM object is finished. Is that correct?

No. DOEVENTS is an interrupt that allows VFP to do things while something else is going on. It gives you an interrupt to handle events that have fired.


>If it is correct, then I suspect some of the larger templates being loaded are not always fully instantiated when control is returned to VFP and then when my next bit of code goes to query an object (like the .Sheets collection that I am seeing), then my code crashes.
>

When you issue an Automation command, control shouldn't return until it's done. But if you're running into issues, a little loop checking for what you need should do the trick.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform