Modal application VBA

Anonymous
2022-12-16T18:00:24+00:00

Dear All,

I have built an application by VBA Excel and created the .xlsm file.

When the xlsm file gets opened a login form appears but If I close this form I'm not able to open any other excel files because the behavior is like a modal form:

Could someone help me to solve/understand the issue?

Thanks

Microsoft 365 and Office | Excel | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

12 answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2023-01-27T08:17:07+00:00

    The issue seems to be this code:

    No.

    The problem is that your concept did not work at all. Make a new file and call a form as shown below.

    Andreas.

    Sub Test()
    UserForm1.Show False
    On Error Resume Next
    With UserForm1
    'Wait till the form is on screen
    Do While Not .Visible
    DoEvents
    Loop
    'Wait while the form is open
    Do While .Visible
    DoEvents
    Loop
    End With
    End Sub

    Was this answer helpful?

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2023-01-26T16:49:14+00:00

    We need to see your file or a sample file that shows the same behaviour.

    Upload it to an online file hoster of your choice and post the download link here.

    Andreas.

    Please see the sample file here

    The issue seems to be this code:

    Private Sub UserForm_Activate() 
    
        TimerStart Me.txtCountdown, Me, Me, Me.txtCountdown 
    
        DoEvents 
    
    End Sub
    

    Thanks

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2022-12-23T15:29:35+00:00

    I found the issue.

    It seems when I close my userform by this code

        Me.Hide 
    
        Unload Me
    

    the application is still running:

    or the menu gets disabled:

    and I have to enable the Design Mode:

    I really don't understand

    Thanks

    Was this answer helpful?

    0 comments No comments
  5. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2022-12-17T06:47:51+00:00

    We need to see your file or a sample file that shows the same behaviour.

    Upload it to an online file hoster of your choice and post the download link here.

    Andreas.

    Was this answer helpful?

    0 comments No comments