Form suddenly broken

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
1,835
Office Version
  1. 2019
  2. 2016
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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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