+ Reply to Thread
Results 1 to 24 of 24

Stop pages showing

  1. #1
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690

    Stop pages showing

    hi guys
    i have this code
    that starts on a sheet called working sheet
    i want it to stay on working sheet asit prints out the selected sheets below.
    is there anyway to stop this from showing the sheets? ie stay on working sheet

    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Don't select the sheets
    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    try

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi guys
    and thanks
    not quite sure how to use yours roy

    andy
    yours still goes through showing each sheet

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    Add these to lines to stop screen updating.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    roy
    i need 2 copies of Receipt of deposit letter
    how do i change you code for that
    as im guessing it ould only print one

  7. #7
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    andy
    that works
    thanks

  8. #8
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    im still having a little trouble as i have this code
    and oonce it gets to call select sheets ( im guessing thats why )
    it jumps to a sheet called ggf and i dont know why
    i want it to work its way through the macro and stay on working sheet

    print supply only macro
    Please Login or Register  to view this content.
    the call select sheets code looks like this

    Please Login or Register  to view this content.
    id appreciate any help
    regards

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    You are selecting sheets throughout the code.

    Why not add a line that selects the 'Working sheet' just before the screenupdating is turned back on again.

  10. #10
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi andy
    sorry to be a pain
    but im not sure what you mean
    there is no select sheet ggf
    so why is it jumping to that sheet?

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    In the loop you set a reference for CurrentSheet. One of the names you test for is GGF. This would suggest that the sheet is processed at some point. If it happens to be the last sheet processed the object variable CurrentSheet will still have a reference to it. So when you use the code at the end to activate CurrentSheet the sheet GGF will be on top.

    Instead explictly re activate the Working sheet.
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    cheers andy
    i sort of understand what you are saying now
    but i have put your code into and its still going to the ggf page
    my code is now
    Please Login or Register  to view this content.

  13. #13
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    You have placed the code in the wrong place.

    Please Login or Register  to view this content.
    If still not working can you post an example workbook. The important thing is the sheet names and their order.

  14. #14
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    no andy its still not working
    and the file is 4.5 mb so its rather huge

  15. #15
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    As I said the important thing is the sheet names and their order. For debugging purposes each sheet only needs something in 1 cell so it will print.

  16. #16
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi andy
    ive attached it as virtually blank

    if you use the print s/o button on the working sheet thats the one im working on

    many thanks
    Attached Files Attached Files

  17. #17
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    and the password ??

  18. #18
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    The problem is you use the same variable to store the active sheet and each sheet within the loop, CurrentSheet.
    And you activate the object just prior to displaying the Print dialog.
    I have added code to re-activate the working sheet.

    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    andy
    thank you
    that works but it still does the same when i have to select the operating sheets for number of doors

  20. #20
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    bump bump bump

  21. #21
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    for anyone who may be kind enough to help me

    im having trouble with a code that asks for operating sheets for number of doors

    this pop up requires me to select from several different sheets
    what i dont want the code to do is show he sheets its printing as it prints

    i want it to stay on "working sheet"

    if anyone could help id be very grateful

  22. #22
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi Steve,

    This is untested &, because I have never used "dialogsheets" before, my suggestions may not work (aka "be way off the mark"!). Anyway, it's worth a shot so here's a revised version of Andy's last posted code with a few changes (marked by hash symbols)...

    Please Login or Register  to view this content.
    When I googled to find out what Dialogsheets are I came across the below explanation
    Microsoft Excel version 5.0 dialog sheets have been replaced by UserForms. It is recommended that you use forms rather than Microsoft Excel version 5.0 dialogs in your custom application. UserForms have more programmable features and enable you to use ActiveX controls (.ocx files). Although the use of UserForms is recommended over the use of Microsoft Excel version 5.0 dialog sheets, dialog sheets can still be used for backward compatibility with earlier versions of Microsoft Excel.
    Source: http://support.microsoft.com/kb/154930
    Excuse my ignorance here, but would with the above in mind it be better for you to use a userform rather than a dialogsheet?
    Or do you need the compatability with older versions of Excel?

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  23. #23
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    rob
    works like a dream thanks so much

  24. #24
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Beauty :-)
    Thanks for the feedback - I'm pleased I could help & I hope that you can follow the logic of my changes?

    Rob

+ 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