Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE to EXCEL faster?
Message
 
À
23/11/1998 10:44:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00160480
Message ID:
00160515
Vues:
24
>I am writing directly to EXCEL sheet. This works fine, but it is extremely slow. Code follows:
>
>KoeObj = CreateObject('Excel.Application')
>KoeObj.Visible = .T.
>
>KoeObj.Workbooks.Add
>KoeBook = KoeObj.ActiveWorkbook
>KoeSheet = Koebook.Activesheet
>
>Dimension Test(5)
>Test(1)=1
>Test(2)=2
>Test(3)=3
>Test(4)=4
>Test(5)=5
>
>For I = 1 to 5
>KoeSheet.Cells(1,I) = Test(I)
>Endfor
>
>- So, can anyone find a way to write the whole array into a range in EXCEL sheet, in just one command? The FOR loop is the slow one.
>
>Thanks in advance..
>MANU

You could write the data to a .dbf table type fox2x. Open the table from Excel to make additional changes via OLE. Then save as an Excel worksheet. This should reduce the total number of OLE calls. This has worked well for me when moving a large amount of data to Excel.

HTH,
Mike
Michael McLain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform