Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing arrays to Excel
Message
De
20/01/2001 03:25:47
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00464985
Message ID:
00466124
Vues:
11
>I'm trying to convert an Excel macro for calculating subtotals to VFP. The VB syntax is :
>
>Selection.SubTotal GroupBy:=3, Function:=xlSum, TotalList:=array(11,12) Replace:=True, PageBreaks:=False, SummaryBelowData:=True
>
>
>My VFP syntax, which isn't working, is:
>
>.selection.subtotal(3,-4157,laList,.t.,.f.,.t.)
>
>
>Any suggestions?

Michael,
Apart from excel being very slow in subtotaling there you say subtotal fields 11,12. An array in Excel is an array just like in VFP. That's you create an array and pass by reference :
dimension laList[2]
laList[1]=11
laList[1]=12
.selection.subtotal(3,-4157,@laList,.t.,.f.,.t.)
PS:If possible use pivot instead. It's fast.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform