Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel times out
Message
 
À
07/01/2005 11:08:14
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:
00975185
Vues:
25
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.


>Hi Mike,
>
>really? You learn something every day. And that's not so easy to find out either, it's sort of inconsistent with the rest of general OOP. May I ask where you got that information?
>
>>This might be unorthodox but it seems to work this way (The orientation is required to be set outside of the WITH/ENDWITH.
>>
Public oSheet
>>oExcel=Createobject("excel.application")
>>oExcel.DisplayAlerts=.F.
>>Set Step On
>>oWorkBook=oExcel.workbooks.Add()
>>oSheet=oWorkBook.Worksheets(1)
>>oSheet.PageSetup.Orientation= 1
>>With oSheet.PageSetup
>>	.FitToPagesTall=1
>>	.FitToPagesWide=1
>>	.CenterHorizontally=.T.
>>	.CenterVertically=.F.
>>	.TopMargin=1*72
>>	.LeftMargin=.75*72
>>	.RightMargin=.5*72
>>	.RightHeader="Page &P of &N"
>>	.LeftHeader="&F"
>>	.RightFooter="Printed on &D"
>>	.FooterMargin=.5*72
>>	.HeaderMargin=.5*72
>>Endwith
>>
>>>the following code stops:
>>>
>>>oExcel=CREATEOBJECT("excel.application")
>>>oExcel.DisplayAlerts=.F.
>>>oWorkBook=oExcel.workbooks.ADD()
>>>oSheet=oWorkBook.Worksheets(1)
>>>WITH oSheet.PageSetup
>>>.Orientation=1      <----------------------------HERE !!!!!!!!
>>>.FitToPagesTall=1
>>>.FitToPagesWide=1
>>>.CenterHorizontally=.T.
>>>.CenterVertically=.F.
>>>.TopMargin=1*72
>>>.LeftMargin=.75*72
>>>.RightMargin=.5*72
>>>.RightHeader="Page &P of &N"
>>>.LeftHeader="&F"
>>>.RightFooter="Printed on &D"
>>>.FooterMargin=.5*72
>>>.HeaderMargin=.5*72
>>>
>>>
>>>ENDWITH
>>>
>>>I assume it times out somehow( running on Terminal Server 2000 )
>>>Can I change the timout when talking to EXCEL?
>>>
>>>Peter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform