Results 1 to 2 of 2
  1. #1
    Dave_D's Avatar
    Dave_D is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    67

    Closing Excel file which has a USERFORM

    I have excel files which have a user form.
    I open the workbook, as READONLY.
    The worksheet form opens upon closing the worksheet. It was designed this way so that the user has a choice of where it needs to be saved. The following code prompts the user form to open:
    oXl.ActiveWorkbook.Close SavingChanges:=False
    when the code executes.
    My code pauses; waiting until I manually click CANCEL on the user form or X to close the form in EXCEL.
    I've tried UNLOAD me which gives me a 361 run time error.
    I need a way to close the workbook without having the form open.

  2. #2
    Dave_D's Avatar
    Dave_D is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    67
    I found my solution. Application.EnableEvents = False

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Excel Userform to Export to Access
    By onejan in forum Access
    Replies: 3
    Last Post: 08-03-2019, 11:17 AM
  2. Trouble closing an Excel file
    By GraeagleBill in forum Programming
    Replies: 4
    Last Post: 02-02-2018, 11:27 PM
  3. Replies: 4
    Last Post: 08-27-2017, 08:21 AM
  4. Replies: 17
    Last Post: 07-21-2017, 01:24 AM
  5. Closing Excel file
    By Dave_D in forum Programming
    Replies: 3
    Last Post: 07-06-2016, 10:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums