Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XL - Subtotalling - is there a header column

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
623
GB
I am using XL automation to open a worksheet and then to subtotal column 6 (invoice value) on change of account type (column 1). It sometimes works.

The relevant code is :
Code:
      .cells.select
      oSelected = .selection
      LOCAL ARRAY laArray(1) 
      laArray(1) = 6
      *!* Call the subtotal function
      oSelected.Subtotal(1, xlsum, @laArray,.T., .F., .T.)  
[\code]
I notice that if column 1 has a header of "Group" and the cells below it have a single character, A, B or C, it works fine, and I get a line below each group which says "A Subtotal" &c.

If however the cells in column A (Below the header) are descriptive, saying "Sales" then "Purchases" then "Overheads", the XL session prompts with a message to say that it needs to know whether there is a header riow or not.

I quite understand the reason for this, but I want to pre-empt it.  Is there a parameter to my oselected.Subtotal() call which will say "Yes, Row 1 is a header row, not to be sorted"?

On a broader level, does anyone know of a reference manual for XL automation.  I have Tamar's book which is a helpful introduction but does not claim to be comprehensive.  As developers we seem to have to rely on trawling the Internet, anecdotal knowledge, VB help &c.  Any possibility of persuading Microsoft to provide more comprehensive documentation, even at this late stage?
 
Thanks Ilyad. I see what you mean, that is probably all the information there is.

I have downloaded this file and copied it to C:\Program Files\Microsoft Office\OFFICE11\1033\VBAXL10.CHM

If I navigate to this and double click there is a help file which is a reference to some features of the interface to XL from Visual Basic. I know about VB but am not an expert. There is no alphabetic index, and no worked examples of interfacing with XL from VFP. As far as I can see there is no introduction to help the VFP developer get started.

I must confess that I did not find the second section "Microsoft Excel Object model" particularly useful. There clearly is some information there, but there is no guide to how to interpret the chart.

It is probably most useful for persons who are already familiar with the interface to XL from VFP.

Thank you again for pointing me towards this help file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top