+ Reply to Thread
Results 1 to 12 of 12

Good old runtime error 5 question

  1. #1
    Registered User
    Join Date
    01-03-2013
    Location
    Hartford CT
    MS-Off Ver
    Excel 2010
    Posts
    20

    Good old runtime error 5 question

    I have also posted this problem in another forum here:
    http://www.thecodecage.com/forumz/mi...post1055009266

    Anyone got any ideas here is my code:

    Its Breaking here:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by martystoked; 10-25-2013 at 07:37 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,265

    Re: Good old runtime error 5 question

    Is the item visible in slicer 2?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    01-03-2013
    Location
    Hartford CT
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Good old runtime error 5 question

    Quote Originally Posted by romperstomper View Post
    Is the item visible in slicer 2?
    Yes the item is sometimes in slicer 2. But for the sake of testing it I picked an item that is in both

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,265

    Re: Good old runtime error 5 question

    Ah, that property uses an array so you probably require an index number, not a name, to access its elements.

  5. #5
    Registered User
    Join Date
    01-03-2013
    Location
    Hartford CT
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Good old runtime error 5 question

    Quote Originally Posted by romperstomper View Post
    Ah, that property uses an array so you probably require an index number, not a name, to access its elements.
    For some weird reason when I opened the file this moring there was no error 5 . But the code still is not syncing up the second slicer cache with the first slicer cache. Any ideas?

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Good old runtime error 5 question

    you've gotta loop through all the items in the second cache not just the visible ones and you don't want the If test
    Please Login or Register  to view this content.
    for instance
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  7. #7
    Registered User
    Join Date
    01-03-2013
    Location
    Hartford CT
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Good old runtime error 5 question

    Quote Originally Posted by JosephP View Post
    you've gotta loop through all the items in the second cache not just the visible ones and you don't want the If test
    Please Login or Register  to view this content.
    for instance
    When I do that I now get a run-time error #5 Invalaid Procedure call or argument.

    and it fails on this code

    Please Login or Register  to view this content.

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Good old runtime error 5 question

    then I reckon you've got items in one slicer cache that aren't in the other so you can't guarantee real synchronization

  9. #9
    Registered User
    Join Date
    01-03-2013
    Location
    Hartford CT
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Good old runtime error 5 question

    Quote Originally Posted by JosephP View Post
    then I reckon you've got items in one slicer cache that aren't in the other so you can't guarantee real synchronization
    This is true. Is there still a way to do it? To select items that are in one slicer if the same items exist in the other? else done select anything??

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Good old runtime error 5 question

    simple way would be to ignore errors
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    01-03-2013
    Location
    Hartford CT
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Good old runtime error 5 question

    Quote Originally Posted by JosephP View Post
    simple way would be to ignore errors
    Please Login or Register  to view this content.
    This kind of works...similar to what I had before...but:

    First off it takes forever to run since there are a ton of slicer items.
    Second when I only have 1 person selected the code selects 3 people in the other slicer. Their names are not even similar, so I am not sure why that is even happening.

    That was why I was trying to check only for selected slicer items.

    Thoughts?

  12. #12
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,265

    Re: Good old runtime error 5 question

    The code only processes items present in slicer 1, so if there are items in slicer 2 that aren't in slicer 1 they will be left selected.

+ 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] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  2. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  3. Runtime Error 1004 Question
    By Armored Wing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2011, 01:19 PM
  4. runtime error 3265 error in a VBA Query to pull info from ERP Database
    By NBVC in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-12-2010, 03:59 PM
  5. Excel xmlHTTP object error message - system/runtime error
    By Porky2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 09:36 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