Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement