+ Reply to Thread
Results 1 to 3 of 3

User form doesn't unload with a print preview in front of it in a code bloc

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    78

    User form doesn't unload with a print preview in front of it in a code bloc

    I have a user form that when the save button that is on it is pressed it runs a ton of code. All of this code can be ignore as it is irrelevant to the problem. The only two parts to the code bloc that seem to conflict with each other and I'm not sure why is the unloading of the user form and the calling of a print function. If I call on the print function before unloading the user form the print preview is displayed but the user form is displayed over it and wont disappear and I cant close the user form or use the print preview. If I call on the print function after unloading the user form the print preview is not displayed as if it didn't work (Most likely it didn't even work). Here is my code:

    Save code bloc
    Please Login or Register  to view this content.
    Print Function code
    Please Login or Register  to view this content.
    Last edited by mdovey; 04-30-2014 at 02:31 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: User form doesn't unload with a print preview in front of it in a code bloc

    Hi, mdovey,

    mabye use
    Please Login or Register  to view this content.
    And I wonder why you set objects to worksheets and do not rely on these in the further code.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: User form doesn't unload with a print preview in front of it in a code bloc

    I will try this thank you very much. Ha XD... do not make fun of my code that make no sense I am fairly new to VBA. I did realise after I had done it but couldn't be bothered to correct it so it just stayed as it was but it still does the job so as for now it will do.

+ 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. User Form freezes when I do Print Preview
    By JieJenn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2012, 12:55 PM
  2. Print preview from user form opened from a user form
    By Brunstgnegg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2011, 05:12 AM
  3. Unload and placement wont work in user form code
    By vn900 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-29-2011, 06:36 AM
  4. Print Preview Doesn't Match Page Break Preview
    By mik7585 in forum Excel General
    Replies: 0
    Last Post: 06-01-2009, 11:32 AM
  5. Replies: 2
    Last Post: 11-07-2005, 05:10 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