Visual Basic error 400?????
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Visual Basic error 400?????

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    TXU
    Posts
    337
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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?

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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?

    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    TXU
    Posts
    337
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

DMCA.com