+ Reply to Thread
Results 1 to 3 of 3

RefreshAll & ShowDetail

  1. #1
    Registered User
    Join Date
    06-06-2017
    Location
    Illinois
    MS-Off Ver
    Excel 2016
    Posts
    25

    RefreshAll & ShowDetail

    I have the following very small macro in several workbooks.

    Please Login or Register  to view this content.
    It's purpose is simply to refresh a pivot table, and then open it up. However, in this workbook it's giving me an "unable to set the showdetail property of the range class" error. Each line works perfectly by itself, but when I put them both together it keeps erroring out. Anyone have any ideas?

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: RefreshAll & ShowDetail

    Hi there,

    The first line will apply to the entire workbook, but the second line will apply to Cell C14 on whichever worksheet happens to be active when the code is executed. An error will occur if the ShowDetail property isn't appropriate to Cell 14 on the active worksheet.

    In general you should always fully qualify the ranges you are using, e.g.

    Please Login or Register  to view this content.

    Hope this helps,

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    06-06-2017
    Location
    Illinois
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: RefreshAll & ShowDetail

    I had tried that already, no luck. This workbook only has the one sheet, so the wrong sheet being active isn't a concern.

    I did notice that if I debug the error, and immediately continue running the macro without doing anything else, it runs without issue.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Unable to set the ShowDetail property of the Range Class
    By dlow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2015, 05:49 AM
  2. RefreshAll
    By Shahadat65 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2015, 05:21 AM
  3. PivotFields.ShowDetail
    By davidktilley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-23-2014, 01:39 PM
  4. Selection.ShowDetail - specific sheet
    By jiggaboi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2013, 01:26 PM
  5. Selection.ShowDetail
    By karinos57 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2009, 10:43 AM
  6. ShowDetail in pivot table
    By bertlef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2006, 08:55 AM
  7. Showdetail method of pivottable unpredictable
    By news.microsoft.com in forum Excel General
    Replies: 0
    Last Post: 05-03-2005, 09:06 PM

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