Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with an object
Message
De
11/01/2002 12:15:24
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00603527
Message ID:
00603582
Vues:
25
>*!* Code
>
>lcFile="PICK01101.XLS"
>
>*!* Autosizing of columns added by Neil Sykes - 11/01/2001
>oleExcelPicklist = GETOBJECT(SYS(5)+SYS(2003)+"\"+LCFILE)
>
>oleExcelPicklist.Cells.Select *!* Crashing here
>oleExcelPicklist.Selection.AutoFit

Oh I never have been succesfull using getobject like that. Here is how I do it :
*1)
oleExcelPicklist = CreateOBJECT('Excel.Application')
with oleExcelPicklist
 .Workbooks.Open(SYS(5)+SYS(2003)+"\"+LCFILE)
 .Activeworkbook.ActiveSheet.Cells.Select   *!* Crashing here
 .Selection.AutoFit
 .visible = .t.
endwith

*2)
oleExcelPicklist = CreateOBJECT('Excel.Application')
with oleExcelPicklist
 .Workbooks.Open(SYS(5)+SYS(2003)+"\"+LCFILE)
 .Activeworkbook.ActiveSheet.UsedRange.Select
 .Selection.AutoFit
 .visible = .t.
endwith

*3)
oleExcelPicklist = CreateOBJECT('Excel.Application')
with oleExcelPicklist
 .Workbooks.Open(SYS(5)+SYS(2003)+"\"+LCFILE)
 .Activeworkbook.ActiveSheet.UsedRange.Columns.AutoFit
 .visible = .t.
endwith

*...
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform