Visual Basic error 400?????

jdavis9

Active Member
Joined
Mar 8, 2002
Messages
337
I have been running the same code for an HMI screen using Excel for some time now and now that I am ready to put it out to Field use, I get a pop up message when pressing a button. The error is Visual Basic error 400.
If the sheet is not protected then there is no message box. The code still works but the pop up is a nuisance. Anyone tell me what is error 400? Or how can I block it?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
On 2002-03-09 09:24, jdavis9 wrote:
I have been running the same code for an HMI screen using Excel for some time now and now that I am ready to put it out to Field use, I get a pop up message when pressing a button. The error is Visual Basic error 400.
If the sheet is not protected then there is no message box. The code still works but the pop up is a nuisance. Anyone tell me what is error 400? Or how can I block it?

Copied from Excel's VBA help:

Form already displayed; can't show modally (Error 400)

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.

Does this help you out?
 
Upvote 0
Well, actually it didn't directly, but it did get me looking in the right direction.
In the various lookups I was modifying a protected cell based on a value found in another file.
So I suppose it did actually help.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,159
Members
448,948
Latest member
spamiki

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