Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel auto
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
01141348
Message ID:
01141383
Views:
29
>Boris. Yes, kept the op and route. I've sent you an email as requested.
>
>>Terry can you post the code you use for Automation? Did you keep Operator and route code in Excel Sheet? I ask you becuase Excel has wonderful function called Subtotal.
>
>Terry
>>

Terry, Run this and tell me is this enough?
#define xlLastCell 11
#define xlSum -4157
LOCAL oExcel AS Excel.Application
oExcel = CREATEOBJECT([Excel.Application])
oExcel.Visible = .t.
oExcel.Workbooks.Open([d:\terry\S28-07-2006.XLS]) && Change with actual path
oExcel.Range([A1],oExcel.ActiveCell.SpecialCells(xlLastCell)).Select()

DECLARE oTotalFields[7]
oTotalFields[1] = 8
oTotalFields[2] = 9
oTotalFields[3] = 10
oTotalFields[4] = 11
oTotalFields[5] = 12
oTotalFields[6] = 13
oTotalFields[7] = 14
WITH oExcel.Selection 
     .Subtotal(1, xlSum, @oTotalFields, .t., .f., .t.)
     .Subtotal(2, xlSum, @oTotalFields, .f., .f., .t.)
ENDWITH
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform