Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 854927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:00:10+00:00 2026-05-15T08:00:10+00:00

I have created a xlt excel template which works fine in Excel 2007 under

  • 0

I have created a xlt excel template which works fine in Excel 2007 under compatibility mode and shows no errors on compatibility check. The template runs a number of Macros which creates pivot tables and charts.

When a colleague tries to run the same xlt on excel 2003 they get a Runtime error 428 (Object does not support this property or method).

The runtime error fails at this point;

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    "raw!R1C1:R65536C37", Version:=xlPivotTableVersion10).CreatePivotTable _
    TableDestination:="Frontpage!R7C1", TableName:="PivotTable2", _
    DefaultVersion:=xlPivotTableVersion10

Any help would be appreciated.

This is the full Macro;

    Sub Auto_Open()
'
' ImportData Macro
' Macro to import data, Data must be in your local D: Drive and named raw.csv
'

'
    Sheets("raw").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;d:\raw.csv", Destination:=Range _
        ("$A$1"))
        .Name = "raw_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 850
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = False
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = True
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
'
' AddMonthColumn Macro
'
'
    Sheets("raw").Select
    Range("AK1").Select
    ActiveCell.FormulaR1C1 = "Month"
    Range("AK2").FormulaR1C1 = "=DATE(YEAR(RC[-36]),MONTH(RC[-36]),1)"
    LastRow = ActiveSheet.UsedRange.Rows.Count
    Range("AK2").AutoFill Destination:=Range("AK2:AK" & LastRow)
    Columns("AK:AK").EntireColumn.AutoFit
    Columns("AK:AK").Select
    Selection.NumberFormat = "mmmm"
    With Selection
        .HorizontalAlignment = xlCenter
    End With
    Columns("AK:AK").EntireColumn.AutoFit
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
'
' Add Report Information [Text]
'
    Sheets("Frontpage").Select
    Range("A2:N2").Select
    Selection.Merge
    ActiveCell.FormulaR1C1 = "Service Activity Report"
    With Selection.Font
        .Size = 20
    End With
    Range("A3:N3").Select
    Selection.Merge
    ActiveCell.FormulaR1C1 = InputBox("Customer Name")
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlCenter
        End With
    Range("A4:N4").Select
    Selection.Merge
    ActiveCell.FormulaR1C1 = InputBox("Date Range dd/mm/yyyy - dd/mm/yyyy")
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlCenter
        End With
'
' IncidentsbyPriority Macro
'

'
    Sheets("Frontpage").Select
    Range("A7").Select
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
        "raw!R1C1:R65536C37", Version:=xlPivotTableVersion10).CreatePivotTable _
        TableDestination:="Frontpage!R7C1", TableName:="PivotTable2", _
        DefaultVersion:=xlPivotTableVersion10
    Sheets("Frontpage").Select
    Cells(7, 1).Select
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.SetSourceData Source:=Range("Frontpage!$A$7:$H$22")
    ActiveChart.ChartType = xlColumnClustered
    With ActiveSheet.PivotTables("PivotTable2").PivotFields("Priority")
        .Orientation = xlRowField
        .Position = 1
    End With
    ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
        "PivotTable2").PivotFields("Case ID"), "Count of Case ID", xlCount
    ActiveChart.Parent.Name = "IncidentsbyPriority"
    ActiveChart.ChartTitle.Text = "Incidents by Priority"
    Dim RngToCover As Range
    Dim ChtOb As ChartObject
    Set RngToCover = ActiveSheet.Range("D7:L16")
    Set ChtOb = ActiveSheet.ChartObjects("IncidentsbyPriority")
    ChtOb.Height = RngToCover.Height ' resize
    ChtOb.Width = RngToCover.Width ' resize
    ChtOb.Top = RngToCover.Top ' reposition
    ChtOb.Left = RngToCover.Left ' reposition
'
' IncidentbyMonth Macro
'

'
    Sheets("Frontpage").Select
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
        "raw!R1C1:R65536C37", Version:=xlPivotTableVersion10).CreatePivotTable _
        TableDestination:="Frontpage!R18C1", TableName:="PivotTable4", _
        DefaultVersion:=xlPivotTableVersion10
    Sheets("Frontpage").Select
    Cells(18, 1).Select
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.SetSourceData Source:=Range("Frontpage!$A$18:$H$38")
    ActiveChart.ChartType = xlColumnClustered
    With ActiveSheet.PivotTables("PivotTable4").PivotFields("Month")
        .Orientation = xlRowField
        .Position = 1
    End With
    ActiveSheet.PivotTables("PivotTable4").AddDataField ActiveSheet.PivotTables( _
        "PivotTable4").PivotFields("Case ID"), "Count of Case ID", xlCount
    ActiveChart.Parent.Name = "IncidentbyMonth"
    ActiveChart.ChartTitle.Text = "Incidents by Month"
    Dim RngToCover2 As Range
    Dim ChtOb2 As ChartObject
    Set RngToCover2 = ActiveSheet.Range("D18:L30")
    Set ChtOb2 = ActiveSheet.ChartObjects("IncidentbyMonth")
    ChtOb2.Height = RngToCover2.Height ' resize
    ChtOb2.Width = RngToCover2.Width ' resize
    ChtOb2.Top = RngToCover2.Top ' reposition
    ChtOb2.Left = RngToCover2.Left ' reposition

'
' IncidentbyCategory Macro
'

'
    Sheets("Frontpage").Select
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
        "raw!R1C1:R65536C37", Version:=xlPivotTableVersion10).CreatePivotTable _
        TableDestination:="Frontpage!R38C1", TableName:="PivotTable6", _
        DefaultVersion:=xlPivotTableVersion10
    Sheets("Frontpage").Select
    Cells(38, 1).Select
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.SetSourceData Source:=Range("Frontpage!$A$38:$H$119")
    ActiveChart.ChartType = xlColumnClustered
    With ActiveSheet.PivotTables("PivotTable6").PivotFields("Category 2")
        .Orientation = xlRowField
        .Position = 1
    End With
    With ActiveSheet.PivotTables("PivotTable6").PivotFields("Category 3")
        .Orientation = xlPageField
        .Position = 1
    End With
    ActiveSheet.PivotTables("PivotTable6").AddDataField ActiveSheet.PivotTables( _
        "PivotTable6").PivotFields("Case ID"), "Count of Case ID", xlCount
    ActiveChart.Parent.Name = "IncidentbyCategory"
    ActiveChart.ChartTitle.Text = "Incidents by Category"
    Dim RngToCover3 As Range
    Dim ChtOb3 As ChartObject
    Set RngToCover3 = ActiveSheet.Range("D38:L56")
    Set ChtOb3 = ActiveSheet.ChartObjects("IncidentbyCategory")
    ChtOb3.Height = RngToCover3.Height ' resize
    ChtOb3.Width = RngToCover3.Width ' resize
    ChtOb3.Top = RngToCover3.Top ' reposition
    ChtOb3.Left = RngToCover3.Left ' reposition
'
' IncidentsbySiteandPriority Macro
'

'
    Sheets("Frontpage").Select
    Range("A71").Select
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
        "raw!R1C1:R65536C37", Version:=xlPivotTableVersion10).CreatePivotTable _
        TableDestination:="Frontpage!R71C1", TableName:="PivotTable3", _
        DefaultVersion:=xlPivotTableVersion10
    Sheets("Frontpage").Select
    Cells(71, 1).Select
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.SetSourceData Source:=Range("Frontpage!$A$71:$H$90")
    ActiveChart.ChartType = xlColumnClustered
    With ActiveSheet.PivotTables("PivotTable3").PivotFields("Site Name")
        .Orientation = xlRowField
        .Position = 1
    End With
    With ActiveSheet.PivotTables("PivotTable3").PivotFields("Priority")
        .Orientation = xlColumnField
        .Position = 1
    End With
    ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
        "PivotTable3").PivotFields("Case ID"), "Count of Case ID", xlCount
    ActiveChart.Parent.Name = "IncidentbySiteandPriority"
'    ActiveChart.ChartTitle.Text = "Incidents by Site and Priority"
    Dim RngToCover4 As Range
    Dim ChtOb4 As ChartObject
    Set RngToCover4 = ActiveSheet.Range("H71:O91")
    Set ChtOb4 = ActiveSheet.ChartObjects("IncidentbySiteandPriority")
    ChtOb4.Height = RngToCover4.Height ' resize
    ChtOb4.Width = RngToCover4.Width ' resize
    ChtOb4.Top = RngToCover4.Top ' reposition
    ChtOb4.Left = RngToCover4.Left ' reposition
    Columns("A:G").Select
    Range("A52").Activate
    Columns("A:G").EntireColumn.AutoFit

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:00:11+00:00Added an answer on May 15, 2026 at 8:00 am

    Try ActiveWorkbook.PivotCaches.Add() instead of ActiveWorkbook.PivotCaches.Create()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a template for Visual Studio 2008 and it currently shows up
Ok I have a excel template file which contains various headers, images etc. I
I'm building an excel template (*.xlt) for a user here, and one of the
I have created a shortlist feature which acts a bit like a shopping cart.
I have created a custom component based on spark.components.HGroup and it works mostly as
Have created a c++ implementation of the Hough transform for detecting lines in images.
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
I have created a C# class file by using a XSD-file as an input.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.