+ Reply to Thread
Results 1 to 2 of 2

How to check if form is modal

Hybrid View

  1. #1
    Registered User
    Join Date
    01-12-2016
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    76

    How to check if form is modal

    Need to test all open forms if modal.

    Dim ctrl As Object
    
    For Each ctrl In VBA.UserForms
        If TypeOf ctrl Is MSForms.UserForm Then
            'if ctrl is modal then unload ctrl else ctrl.hide
            End If
    Next ctrl

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: How to check if form is modal

    Have a look at this http://www.excelforum.com/excel-prog...-modeless.html

+ 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. [SOLVED] Modeless Form from Modal Form
    By EssoExplJoe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2016, 07:01 PM
  2. Non modal form closes with modal form when it is closed
    By ryan.wherry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2015, 12:45 PM
  3. RTD.RefreshData crashes when invoked from modal form
    By a.collister in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2014, 01:17 PM
  4. Must close or hide topmost modal form first
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2011, 01:41 PM
  5. Showing a modeless form on top of a modal form
    By foxguy in forum Excel General
    Replies: 15
    Last Post: 09-06-2010, 03:23 PM
  6. Retaining focus on non-modal form
    By AndySuk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2007, 03:06 PM
  7. Non -Modal form disappears
    By Chris W in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2005, 03:06 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