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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Subtotals

Status
Not open for further replies.

Dewey12

Programmer
Dec 17, 2001
6
CA
I'm trying to dynamically create subtotals when
opening an excel spreadsheet from a web application.
Here is my code;

Set excelApp = createobject("excel.Application")
excelApp.Visible = True

excelApp.Workbooks.open("..//../../../Template.xls")

worksheet.activate
Set sheet = worksheet.Sheets(1)
sheet.Activate
set queryTables = sheet.querytables
set queryTable = queryTables.Add("data" , sheet.Range("A5"))

queryTable.Name = "SurveyData"
queryTable.FieldNames = True
queryTable.RowNumbers = False
queryTable.FillAdjacentFormulas = False
queryTable.PreserveFormatting = True
queryTable.RefreshOnFileOpen = False
queryTable.BackgroundQuery = True
queryTable.RefreshStyle = xlInsertDeleteCells
queryTable.SavePassword = True
queryTable.SaveData = True
queryTable.AdjustColumnWidth = True
queryTable.RefreshPeriod = 0
queryTable.Refresh

//This is the code I got from the Excel Object Module(below)

sheet.Range.("A5").subtotal 1,xlSum, 7 ,false, true, xlsummarybelow


ANY help would be greatly appreciated.

Dewey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top