+ 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)

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