The "Get_Excel" function (found on the forums) gives me a solid handle on the workbook. And, this code works... it's just... ugly:
xl := Excel_Get()
t := xl.ActiveSheet.ListObjects(1)
t.ShowTotals := 1
colName := "A Known Column Heading Name"
xl.Range(t.Name . "[[#Totals],[" . colName . "]]").Formula := "=SUBTOTAL(109,[colName])" ; this is the line I'm trying to improve upon
This is working but I can't seem to piece this together a more elegant solution using table objects.
I wish this would work but it doesn't:
t.ListColums(colName).TotalsRowRange.Formula := "=SUBTOTAL(109,[colName])"
Any ideas? Again, I'm not trying to use the column's index number here... I have a column name in hand and want to apply the formulas based on know column names.