Form suddenly broken

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,072
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Was designing a Form and everything working fine when all of a sudden everything you click on "dings" at you.

I have to Control-Beak and the code is hung on the Line MyForm.Show.

Pressing F8 re-runs the same subroutine and/or (at times) has brought up

Run-time error '400':
Form already displayed; can't show modally

From Google
You can't use the Show method to display a visible form as modal. This error has the following cause and solution:

You tried to use Show, with the style argument set to 1 - vbModal, on an already visible form.

Use either the Unload statement or the Hide method on the form before trying to show it as a modal form.

I do have ShowModal set true, but this has been ok for three days until now.

I've tried setting this False also put unload before show, but it makes no difference.
Can anyone help, please
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I meant to say I'm remmed out all the code in the Form too.
For a test I exported the Form to a new instance of Excel and the problem remained.
So I made a new Form, copied everything from the original, and it tested ok.

I then deleted it from the original workbook, and imported the replacement and that works too.

Suppose that means the Form corrupted itself for no apparent reason. That's a bit of a worry...

It is a common occurrence? Are there better / other fixes or solutions?
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top