Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing arrays to Excel
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00464985
Message ID:
00465072
Views:
17
>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.)

I haven't used this before, so this is pretty much a guess, but in looking at the Help, it appears that "array(11,12)" is actually a call to Excel's Array function. So instead of passing the VFP array laList as the third parameter, try:
oExcel.Array(11,12)
In Excel's VBA Help file, there's a topic called "Array Function Examples" that might shed more light. Also see "Referring to More Than One Sheet." The hyperlink to the actual Array function claims not to find the VBA Help -- so either it's broke, or the IT department didn't install all the files.

Like I said, it's a guess from looking at the Help--but an educated guess <s>. Hope this helps!

- della
Previous
Reply
Map
View

Click here to load this message in the networking platform