+ Reply to Thread
Results 1 to 4 of 4

Close Userform2 on workbook close

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Close Userform2 on workbook close

    Is it possible to close this userform in workbook close,if user forgets to close userform then problem begin.
    Last edited by zplugger; 08-12-2015 at 10:25 AM.

  2. #2
    Registered User
    Join Date
    04-22-2013
    Location
    Philippines & Australia
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    73

    Re: Close Userform2 on workbook close

    Put this code into the Workbook BeforeClose Event

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Close Userform2 on workbook close

    Hi zplugger,

    The UserForm should automatically close, when you close the Workbook. If you need to save data from the UserForm before the Workbook Closes, you probably want to use the UserForm_QueryClose routine:
    Please Login or Register  to view this content.
    You can take action based on the CloseMode. For CloseMode details see: https://msdn.microsoft.com/en-us/lib.../Gg278635.aspx


    Please note that UserForm2.Hide does not close the UserForm, it only makes the UserForm not visible. For Users of Excel 2007, there are known problems using the .Hide command.

    To close the UserForm you need:
    Please Login or Register  to view this content.
    Lewis

  4. #4
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Close Userform2 on workbook close

    Thank You for your time LJMetzger

+ 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. Copy from first workbook, close open new workbook paste close
    By johncarr1952 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-04-2021, 08:50 AM
  2. how to close userform using commndbutton and set automatic close at certain time
    By fatinmunie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2014, 12:51 PM
  3. [SOLVED] UserForm1 to Open UserForm2 & close itself but transferring txtbox entry from Form1 to 2
    By Colin Smit in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-08-2014, 02:34 AM
  4. vba code to disable only close button and close through a button in Excel workbook
    By atif_ar in forum Excel Programming / VBA / Macros
    Replies: 47
    Last Post: 11-23-2014, 02:41 PM
  5. [SOLVED] VBA Prompt to close PDF so file can be overwrtitten or close automatically
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2014, 12:31 PM
  6. Disable close workbook but still force users to close thru command button
    By rathig in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2013, 07:29 AM
  7. Replies: 0
    Last Post: 06-10-2005, 01: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