+ Reply to Thread
Results 1 to 9 of 9

Printpreview + refreshAll

  1. #1
    Registered User
    Join Date
    12-16-2021
    Location
    Belgium
    MS-Off Ver
    /
    Posts
    12

    Printpreview + refreshAll

    Hello,

    I'm trying to create a VBA macro button with following code.
    Purpose would be to have a printpreview of certain tabsheets in my excel (not every tabsheet needs to be print previewed).

    Tabsheet 'Dashboard' and 'Prestations' are visible, tabsheet 'volume' is not visible, but hidden (not via VBA).
    Tabsheet volume contains out of a pivottable which needs to be refreshed before the print.preview, however if I run following code it doesn't refresh the pivottable while having the printpreview.

    Please Login or Register  to view this content.
    Thanks,
    Cara
    Attached Files Attached Files
    Last edited by Cara pils; 06-23-2022 at 05:22 AM.

  2. #2
    Registered User
    Join Date
    12-16-2021
    Location
    Belgium
    MS-Off Ver
    /
    Posts
    12

    Re: Printpreview + refreshAll

    Edit: I've attached a testfile which would explain the above more in-depth.

  3. #3
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,161

    Re: Printpreview + refreshAll

    The attached example, unfortunately, explains nothing.
    It is probably the case that the Input sheet contains a query to an external source. If that is the case, it is the property settings of that query that are the problem, rather than the pivot table itself. If this is the case, in the properties of the query, uncheck the "Enable background refresh" box. Make sure that the "Refresh this connection on Refresh All" box is checked.

    Artik

    5fRE7.png

  4. #4
    Registered User
    Join Date
    12-16-2021
    Location
    Belgium
    MS-Off Ver
    /
    Posts
    12

    Re: Printpreview + refreshAll

    Hello Artik,,

    Thanks for the reply.

    The tabsheet Input only contains out of a table where manual input needs to be inputted (volumes) and doesn't contain out of any query or any linked external sources unfortunately..

    Snip from VBA code which is placed in tabsheet DASHBOARD:
    Attached Images Attached Images
    Last edited by Cara pils; 06-23-2022 at 07:43 AM.

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,161

    Re: Printpreview + refreshAll

    Please add attachments according to the yellow banner at the top of this page. Other forms of adding attachments do not always work.

    Artik

  6. #6
    Registered User
    Join Date
    12-16-2021
    Location
    Belgium
    MS-Off Ver
    /
    Posts
    12

    Re: Printpreview + refreshAll

    Updated my post based on your feedback.

  7. #7
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,161

    Re: Printpreview + refreshAll

    Unfortunately, in my simple example, I don't notice problems with refreshing the pivot table before the print preview.

    Artik
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-16-2021
    Location
    Belgium
    MS-Off Ver
    /
    Posts
    12

    Re: Printpreview + refreshAll

    Seems like the filter on my pivottable is causing the error.

    I've filtered the pivottable by excluding all zero values (as I only want to print the volumes with > 0 volume).

    Any workaround around that?

  9. #9
    Registered User
    Join Date
    12-16-2021
    Location
    Belgium
    MS-Off Ver
    /
    Posts
    12

    Re: Printpreview + refreshAll

    Found a working way around.

    I deleted the pivottable and created a formula based table on my original list which excludes all zero values.

    Thanks for the help!

+ 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. RefreshAll & ShowDetail
    By Moragtao in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2019, 10:39 AM
  2. PrintPreview
    By oddbjorn-j in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2017, 10:56 AM
  3. RefreshAll
    By Shahadat65 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2015, 05:21 AM
  4. .activeworkbook.refreshall
    By MelissaGregory in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-03-2013, 07:36 PM
  5. RefreshAll not quick enough
    By WhytheQ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 09:20 AM
  6. [SOLVED] ActiveWorkbook.RefreshAll
    By Matt Cromer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2006, 03:50 PM
  7. [SOLVED] printpreview
    By Alex in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-12-2005, 06:05 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