+ Reply to Thread
Results 1 to 9 of 9

Pivot Table VBA code: Out of Range Error

Hybrid View

  1. #1
    Registered User
    Join Date
    02-16-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Pivot Table VBA code: Out of Range Error

    Hi Andy,

    The code works marvels on the test workbook I sent you, however, when I try applying it to the original workbook I get the following error:

    Runtime error: 5, Invalid Procedure Call or Argument for the following line again:

    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    "Phone Bill Sort!R5C1:R34665C4", Version:=xlPivotTableVersion14). _
    CreatePivotTable TableDestination:="Summary Sheet!R5C1", TableName:= _
    "PivotTable1", DefaultVersion:=xlPivotTableVersion14

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Pivot Table VBA code: Out of Range Error

    does it make any difference if you enclose the sheet names, that contain spaces, within single quotes? As I did in the code I posted.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1