+ Reply to Thread
Results 1 to 2 of 2

Run time error 1004 - Unable to set the show details ????

  1. #1
    Registered User
    Join Date
    06-03-2009
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Run time error 1004 - Unable to set the show details ????

    Hi
    I have created a macro in Excel 2007 that creates a pivot table but quite often when I run it I get the following message...

    Runtime error 1004
    Unable to set the ShowDetail property of the Range class..


    This is the code...and it's at the very last bit that Excel shows up as the problem..i.e. Selection.ShowDetail = True

    I suspect that it's something obvious. I'm using this code to


    ActiveWorkbook.PivotCaches.Create(SourceType:=xlConsolidation, SourceData:= _
    Array("Prodn_Plan_Prep!R1C1:R2000C18"), Version:=xlPivotTableVersion10). _
    CreatePivotTable TableDestination:="", TableName:="PivotTable1", _
    DefaultVersion:=xlPivotTableVersion10
    ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
    ActiveSheet.Cells(3, 1).Select
    ActiveSheet.PivotTables("PivotTable1").DataPivotField.PivotItems("Sum of Value" _
    ).Position = 1
    Range("B3").Select
    ActiveSheet.PivotTables("PivotTable1").PivotFields("Column").Name = "mmm-yy"
    Range("S20000").Select
    Selection.ShowDetail = True
    End Sub
    Last edited by shg; 05-31-2010 at 01:41 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run time error 1004 - Unable to set the show details ????

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.
    Entia non sunt multiplicanda sine necessitate

+ 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