+ Reply to Thread
Results 1 to 3 of 3

Slicer macro leaves project loaded in VBA Editor when workbook is closed

  1. #1
    Registered User
    Join Date
    01-05-2016
    Location
    Oxford, England
    MS-Off Ver
    Office 2010 - 32 bit version
    Posts
    2

    Slicer macro leaves project loaded in VBA Editor when workbook is closed

    I am using some code that I have adapted from
    http://stackoverflow.com/questions/2...ll-pivot-table

    The code is designed to make it easy for users to disconnect / reconnect slicers to pivot tables. The code works, but has an unfortunate effect on the way in which Excel manages VBA projects.

    With my setup of 32 bit Excel 2010 running in Windows 7, if the macro is run and the workbook is then closed without saving, an orphaned copy of the VBA project remains visible in the VBA Editor and this can only be cleared by closing and restarting Excel.

    Here is the code, and I've attached a workbook containing some data, slicers and buttons to run the code.

    Has anyone else come across this quirk? Is there another approach that I could take to automate disconnecting and reconnecting slicers to pivot tables which does not mess up the way in which the VBA editor manages its memory?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-05-2016
    Location
    Oxford, England
    MS-Off Ver
    Office 2010 - 32 bit version
    Posts
    2

    Re: Slicer macro leaves project loaded in VBA Editor when workbook is closed

    I seem to have fixed this bug by not using the slicer object. My revised code for the ManageSlicer function is

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2016
    Posts
    1

    Re: Slicer macro leaves project loaded in VBA Editor when workbook is closed

    Late to the party... Just wanted to point out that it's the use of oSlicer.SlicerCache, in the original post, that makes the workbook stick around in the VBA editor. The workaround is to get to the SlicerCache through another path, as in Peter's second post.

+ 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. Replies: 1
    Last Post: 07-31-2014, 01:43 AM
  2. Replies: 9
    Last Post: 07-16-2014, 03:32 AM
  3. Ghost project remain in VB Editor after Workbook is closed
    By Kiwoop in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2013, 05:03 AM
  4. [SOLVED] macro not working properly until vb editor is opened and closed again
    By freddiethomas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-14-2012, 03:58 AM
  5. Slicer Macro - unfilter another slicer on selection
    By chadheins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2012, 10:41 AM
  6. VBA Project and Modules Remain in Project Explorer after workbook closed
    By avr5iron in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 03-09-2012, 11:38 AM
  7. Screen Res change macro leaves me in VB Editor instead of workshee
    By Peter Rooney in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-04-2005, 05:05 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