Closed Thread
Results 1 to 6 of 6

How To Run code Before Print Preview

  1. #1
    Registered User
    Join Date
    10-13-2010
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2007
    Posts
    4

    How To Run code Before Print Preview

    Hi All,

    Does anyone know how to execute code before print preview?

    Is it possible?

    Kind Thanks in advance,
    Michael
    Last edited by mstasko1990; 10-29-2010 at 02:01 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How To Run code Before Print Preview

    More details please
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-13-2010
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How To Run code Before Print Preview

    Hi,

    The desire is to run a few lines of code (to manipulate cells, change values,etc...)
    when a user selects 'print preview' from the file menu.

    That is, the code should run before the print preview is displayed to the user

    * Something like a _BeforePrintPreview() event would be great, but I don think that exists...

    Thanks,
    M

    ***This same inquiry has been posted here: http://www.ozgrid.com/forum/showthread.php?t=147540 ***
    Last edited by mstasko1990; 10-29-2010 at 01:32 PM.

  4. #4
    Registered User
    Join Date
    10-13-2010
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How To Run code Before Print Preview

    Solved--Not too hard just needed to Use Worksheet_BeforePrint()

    See: http://www.ozgrid.com/forum/showthread.php?t=147540

  5. #5
    Registered User
    Join Date
    08-04-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    10

    Re: How To Run code Before Print Preview

    This doesn't work for Excel 2010 or newer.

    The user can click the print preview button or the print command which shows the preview. The
    Please Login or Register  to view this content.
    event doesn't fire until the user clicks Print from that screen.

    Does anyone have a workaround for this? I've scoured the web and coming up blank.

    I change the users printer to the XPS Printer before doing formatting as networked and redirected printers cause the macros to take 3-4 times as long. I change to the XPS printer and want to change it back to the users default right before clicking print or print preview.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How To Run code Before Print Preview

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

Closed Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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