Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Muhammad Zahid
  Where is Muhammad Zahid?
 Karachi
 Pakistan
 Muhammad Zahid
 To: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 Tags
Subject: RE: Calling Auto subtotal Function in Excel
Thread ID: 228076 Message ID: 228604 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Wednesday, May 20, 2009 8:19:33 AM         
   


> Hi,
>
> In Excel there are:
> - Excel Math function "Subtotal",
> - Subtotal Method that one can apply to particular range, or to the sheet
> - Subtotals Properties used for Pivot table fields
> - with Data Subtotal User Dialog user can manually apply range subtotal method to selected range.
>
> You mentioned "xlDialogSubtotalCreate"; so I assume that you want to create subtotals for selected Range containing Data and Group_by_Column. Also I assume that you want to do it with Automation. If it is the case, then you can follow the example below. Otherwise give details of what you want to do exactly.
>
>
xlsum=-4157
> oExcel= CREATEOBJECT("Excel.Application")
> with oExcel
> 	.DisplayAlerts = .f.
> 	.Visible=.t.
> 	.Workbooks.Add()
> 	.ActiveSheet.Range("A1")="GroupByColumn"
> 	.ActiveSheet.Range("B1")="Data"
> 	
> 	FOR ia=1 TO 10
> 		.ActiveSheet.Range("A"+TRANSFORM(ia+1)).value=INT(ia/6)
> 		.ActiveSheet.Range("B"+TRANSFORM(ia+1)).value=ia
> 	ENDFOR
> 
> 	dimension atemp[1]
> 	atemp[1] = INT(ia/6)+1		&& number of expected groups
> 
> 	.ActiveSheet.Range("A2:B11").Subtotal(1,xlSum, @atemp,.t.,.f.,.t.)
> 
> endwith
> 
> *oExcel.quit()
> oExcel=.NULL.

>
>
>
>
>
>
>
> Best Wishes,
>
> Yuri Rubinov

Exactly I need this.
Thank you very much to help me.

mzahid

ENTIRE THREAD

Calling Auto subtotal Function in Excel Posted by Muhammad Zahid @ 5/15/2009 8:00:02 AM
RE: Calling Auto subtotal Function in Excel Posted by Yuri Rubinov @ 5/15/2009 5:08:19 PM
RE: Calling Auto subtotal Function in Excel Posted by Muhammad Zahid @ 5/20/2009 8:19:33 AM
RE: Calling Auto subtotal Function in Excel Posted by Yuri Rubinov @ 5/20/2009 3:32:14 PM
RE: Calling Auto subtotal Function in Excel Posted by Cetin Basoz @ 5/20/2009 3:57:07 PM
RE: Calling Auto subtotal Function in Excel Posted by Yuri Rubinov @ 5/20/2009 4:31:16 PM