+ Reply to Thread
Results 1 to 6 of 6

VBModeless question

  1. #1
    Registered User
    Join Date
    03-26-2015
    Location
    wisconsin, united states
    MS-Off Ver
    2010
    Posts
    47

    Question VBModeless question

    I have an InfoForm that I would like to display while code is loading, but that also prevents data from being changed in the excel spreadsheet itself.

    The below code does handle the first part, but it does not prevent data from being entered into excel.
    If anyone has a simple, efficient solution...please assist. Thanks.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    930

    Re: VBModeless question

    Remove the 'vbModeless' That does not affect the code loading. The thing that is affected by a modal userform is the user interface with Excel. The only code affected is the code which loads the userform, and it will stop until the form is closed.
    Last edited by JLGWhiz; 03-08-2018 at 09:14 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel.

  3. #3
    Registered User
    Join Date
    03-26-2015
    Location
    wisconsin, united states
    MS-Off Ver
    2010
    Posts
    47
    In my case I was attempting to use it as a quick fix progress display. So I am looking for the code that calls the userform to continue to run while excel is locked to the user. Any other suggestions.

  4. #4
    Registered User
    Join Date
    03-26-2015
    Location
    wisconsin, united states
    MS-Off Ver
    2010
    Posts
    47
    Realizing now though I could take your suggestion then call the code from inside the modal userform progress bar...thanks

  5. #5
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: VBModeless question

    mbrandt,

    Keep the ShowModal property set to True and initiate your code from the InfoForm_Activate. The form will display and lock excel while your modular code is initiated in the background.

    Please Login or Register  to view this content.
    HTH,
    Maud

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,081

    Re: VBModeless question

    Hi,

    You might also use
    Please Login or Register  to view this content.
    to prevent users from doing anything while your code is running.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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