Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to add subtotals to exported excel file.
Basically I have a excel file on my drive and I'm trying to add subtotals but with no luck.
Here is the code:
Set oXL=CreateObject("Excel.Application") f_name="C:\test\test.xls"
Set oWB=oXL.Workbooks.Open(f_name)
oXL.Visible = True
oXL.Range("A1:Q156").Select
oXL.Selection.Subtotal 1, xlCount, Array( 2, 3 ), False, False, False
I get an error "Subtotal method of Range class failed"
But when I copy
Selection.Subtotal 1, xlCount, Array( 2, 3 ), False, False, False
straight to excel and execute it all goes well.
I also tried
set WW = oXL.Selection.Subtotal(1, xlCount, Array( 2, 3 ), False, False, False)
..then I tried with only 3 parameters, nothing works on QV project.
Why is that and how to solve it?
anyone?