Application-defined Or Object-defined Error Pivot Table
Contents |
here for a quick overview of the site Help Center Detailed application defined or object defined error vba pivot table answers to any questions you might have Meta Discuss the application defined or object defined error excel workings and policies of this site About Us Learn more about Stack Overflow the company application defined or object defined error access Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join application defined or object defined error 32809 the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Pivots and Run-time error 1004: Application-defined or object-defined error up vote 1 down vote favorite I'm quite new to macros and
Application Defined Or Object Defined Error In Macro
VBA coding and I'm trying to create a really simple macro that takes the data from a table with 33 columns and convert it to a pivot. Only the last 3 columns (31, 32, 33) contains numbers and I need that to appear on the pivot as I want to compare current month, last month and the movement from month on month. Here is my code so far: Sub Macro6() ' ' Macro6 Macro ' ' Dim shtSrc As Worksheet, shtDest As Worksheet Dim pc As PivotCache Set shtSrc = ActiveSheet Set shtDest = shtSrc.Parent.Sheets.Add() shtDest.Name = shtSrc.Name & "-Pivot" Set pc = ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, _ SourceData:=shtSrc.Range("A1").CurrentRegion) pc.CreatePivotTable TableDestination:=shtDest.Range("A3"), _ TableName:="PivotTable1" With shtDest.PivotTables("PivotTable1") .InGridDropZones = True .RowAxisLayout xlTabularRow End With Set shtDest = ActiveSheet With ActiveSheet.PivotTables("PivotTable1").PivotFields("Name") .Orientation = xlRowField .Position = 1 End With ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _ "PivotTable1").PivotFields(31), "Last month", xlSum ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _ "PivotTable1").PivotFields(32), "This mon
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta
Application Defined Or Object Defined Error Vba 1004
Discuss the workings and policies of this site About Us Learn application defined or object defined error vba formula more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us application defined or object defined error vba range Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like http://stackoverflow.com/questions/23883640/pivots-and-run-time-error-1004-application-defined-or-object-defined-error you, helping each other. Join them; it only takes a minute: Sign up Application defined or object defined error in creating macro for pivot up vote 2 down vote favorite I am trying to develop a macro for PivotTable. I am getting Invalid procedure call or argument error: ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "Sheet1!R1C1:R33C10", Version:=xlPivotTableVersion15).CreatePivotTable _ TableDestination:="Sheet3!R3C1", TableName:="PivotTable2", DefaultVersion http://stackoverflow.com/questions/33707467/application-defined-or-object-defined-error-in-creating-macro-for-pivot _ :=xlPivotTableVersion15 excel excel-vba share|improve this question edited Nov 14 '15 at 10:47 asked Nov 14 '15 at 10:33 swaminadh 112 is that the complete error message? –jogo Nov 14 '15 at 10:53 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Browse other questions tagged excel excel-vba or ask your own question. asked 10 months ago viewed 35 times Related 0not able to create pivot using macro if data is just fetched from db0Creating pivot table in VBA0runtime errors with excel recorded macro0Excel Macro run time error0Application or object defined error1Runtime error '1004' while creating a pivot ta
Forum Microsoft Office Application Help - Excel http://www.excelforum.com/showthread.php?t=397991 Help forum Excel Programming / VBA / Macros Run-time Error 1004: Application-defined or Object-defined Error To get replies by our experts at nominal charges, follow this link to buy points and post your thread in our Commercial Services forum! Here defined or is the FAQ for this forum. + Reply to Thread Results 1 to 7 of 7 Run-time Error 1004: Application-defined or Object-defined Error Thread Tools Show Printable Version Subscribe to this Thread… Mark this thread as solved… Rate This Thread defined or object Current Rating Excellent Good Average Bad Terrible Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 08-22-2005,08:05 PM #1 Adrian Guest Run-time Error 1004: Application-defined or Object-defined Error Hi, Can anyone help me. I get this message when using the Macro's and I'm not sure how to fix... Below is a snippet of code - The error occurs on the last three lines of code... Any suggestions? Thanks Sheets.Add Sheets.Add Sheets("Sheet1").Select ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _ "Sheet1!R1C1:R25000C37").CreatePivotTable TableDestination:="", TableName:= _ "PivotTable1", DefaultVersion:=xlPivotTableVersion10 ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:= _ "StatusDescription" ActiveSheet.PivotTables("PivotTable1").PivotFields("StatusDescription"). _ Orientation = xlDataField With ActiveSheet.PivotTables("PivotTable1").PivotFields("StatusDescription") .PivotItems("(blank)").Visible = False End With Sheets("Sheet1").Select ActiveWorkbook.Worksheets("Sheet4").PivotTables("PivotTable1").PivotCache. _ CreatePivotTable TableDestination:="", TableName:="PivotTable2", _ DefaultVersion:=xlPivotTableVersion10 Register