Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel times out
Message
 
À
07/01/2005 17:37:41
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00975101
Message ID:
00975381
Vues:
12
>One thing I noticed when handling oExcel is that the interface to it (and to browser object as well, not necessarily related to this) is quirky, at least. One thing that it doesn't like is going too deep in a hierarchy of reference. Some things like

That has been my experience as well. And it seems to be that case for most automation (ie. Outlook, internet explorer, Word, Excel). Everytime you change level in the hierarchy make a reference to it. Here is perfect example, the internet explorer document property.
o = CREATEOBJECT('internetexplorer.application')
o.Navigate2("www.microsoft.com")
o.Document. && Nothing show up here
And yet if you do this
o = CREATEOBJECT('internetexplorer.application')
o.Navigate2("www.microsoft.com")
oDoc=o.Document
oDoc. && Now the properties show up
>>Trial and error. Recently someone else had asked me about FitTopagesWide and did not know why it didn't and after trial and error, I noticed also that the order that properties are set seems to make a difference. For example if you move the orientation setting after the FitTopagesWide and the .FitToPagesTall, the result are not as expexted. Also after testing the code posted here, I too get an error message, and after moving the orientation out of the with/endwith, the error went away.
>
>One thing I noticed when handling oExcel is that the interface to it (and to browser object as well, not necessarily related to this) is quirky, at least. One thing that it doesn't like is going too deep in a hierarchy of reference. Some things like
>
>
oExcel.ActiveSheet.Range("blabla").selection.rows
>
>may not work at all (OK, this one might - but I've seen a few which don't), but
>
>
oSh=oExcel.activesheet
>oRng=oSh.range("blabla")
>oSel=orng.Selection
>nRows=oSel.rows
>
>seems to work much better - and (surprise) the properties of these intermediate variables are visible by intellisense while debugging, which otherwise doesn't work if you got more than two levels of hierarchy. I have no explanation for this, it's probably something in VB or whichever tool they use to do stuff, and the way it exports its PEMs in TLB files.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform