Results 1 to 2 of 2

I am getting this error by below macro "Invalid procedure call arguement" please help

Threaded View

shoaibaligwl I am getting this error by... 11-06-2017, 09:31 AM
AliGW Re: I am getting this error... 11-06-2017, 09:39 AM
  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    New delhi,India
    MS-Off Ver
    2016
    Posts
    13

    I am getting this error by below macro "Invalid procedure call arguement" please help

    Option Explicit
    
    Sub pivottb()
    Dim pt As PivotTable
    Dim pc As PivotCache
    
    Set pc = ThisWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=ThisWorkbook.Worksheets("sheet1").Range("a1").CurrentRegion)
    Worksheets.Add
    Set pt = ActiveSheet.PivotTables.Add(PivotCache:=pc, Tabledestination:=ActiveSheet.Range("a1"))
    
    With pt
    
    .PivotFields("name").Orientation = xlRowField
    .PivotFields("age").Orientation = xlDataField
    .PivotFields("sale").Orientation = xlColumnField
    .PivotFields("profit").Orientation = xlPageField
    
    End With
    
    With pt.PivotFields("sale")
          .Caption = "count of net sales"
          .Function = xlCount
          
          End With
    
    End Sub
    Last edited by AliGW; 11-06-2017 at 09:39 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. help with "invalid procedure call or argument" error.
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-02-2017, 11:41 AM
  2. [SOLVED] run time error '5" invalid procedure call or argument
    By jay11 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-12-2015, 12:29 PM
  3. Invalid Call procedure or arguement
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2014, 12:46 PM
  4. Run-time Error 5 "Invalid Procedure Call or Argument"
    By dinakar.yadav in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2014, 09:22 AM
  5. Run time error '5': Invalid procedure call or arguement (excel 2007)
    By Excel_novice1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2012, 05:40 PM
  6. "Invalid procedure call or argument" error when creating Pivot table
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2009, 06:02 AM
  7. error 'Invalid Procedure Call or Arguement'
    By chrismann85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2009, 07:28 AM

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