+ Reply to Thread
Results 1 to 3 of 3

Userform does not open with any other workbook open but only on second workbook launch.

Hybrid View

lOYvEpi6M87nEoIF0ul8 Userform does not open with... 07-15-2023, 04:36 PM
Artik Re: Userform does not open... 07-15-2023, 06:45 PM
lOYvEpi6M87nEoIF0ul8 Re: Userform does not open... 07-15-2023, 07:02 PM
  1. #1
    Registered User
    Join Date
    08-04-2010
    Location
    United States
    MS-Off Ver
    Office 365 for windows
    Posts
    62

    Question Userform does not open with any other workbook open but only on second workbook launch.

    Hello. Attached is my workbook with all confidential information removed.

    Here is my issue:

    If I have any workbook including a new empty workbook open and I launch my workbook, my userform appears. -But only the first time I open my workbook.

    If I leave the first workbook open and close my workbook using a button I have to unload the form, save, then close the workbook and then simply re-open it, the userform does not appear. It seems to open on the first launch only.

    When the userform does not open I can click the X and try to close excel which ordinarily is disabled in my code. I am then prompted to save the changes to the workbook.

    I've been trying to determine the cause for this problem for a long with no success. Over time I've reinstalled the both the Office program and Windows, from new downloads.

    Any help would be extremely appreciated. I'd really like to fix the issue.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,557

    Re: Userform does not open with any other workbook open but only on second workbook launch

    In the btnclose_Click procedure in the FrmPunches module you disable the event response:
    Application.EnableEvents = False
    but there is no enable. When Help.xlsm was the only open file, this will close the workbook and the Excel application. At this point, the event response is reset, it takes the value True (it would be more true to say that when the Excel application is opened, the EnableEvents property gets the value True).
    If the Help.xlsm file was NOT the only open file the workbook is closed, and the Excel application remains open along with other open files. At this point, EnableEvents has the value False, which means no events will occur, so reopening the Help.xlsm file will NOT trigger the Workbook_Open event procedure.

    Artik

  3. #3
    Registered User
    Join Date
    08-04-2010
    Location
    United States
    MS-Off Ver
    Office 365 for windows
    Posts
    62

    Cool Re: Userform does not open with any other workbook open but only on second workbook launch

    Ha ha. Well, now I feel silly. Thank you very much for taking the time to help me resolve my issue. I appreciate that.

+ 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. Workbook Open event - userform gets displayed over another workbook
    By hemantparmar in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-18-2019, 11:56 AM
  2. [SOLVED] vba to open excel workbook if alrady open by other user show userform and exit sub
    By bluepomme in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-06-2018, 07:14 PM
  3. Open/Launch Embedded file in workbook
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-27-2015, 05:23 PM
  4. Macro to open a closed workbook and select copy cells into an open workbook
    By helloganesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2013, 02:00 PM
  5. [SOLVED] Macro to copy data from open workbook to next open line of new workbook
    By nhtodd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2012, 09:42 PM
  6. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM
  7. Open workbook via another workbook and not display userform
    By Khaos176 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2009, 02:17 PM

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