VBR50002: Unusable dialog answer
Severity: Error · Family: VBR (runtime semantics), RD-VBA's own run-time errors ·
Source metadata: VBRuntimeErrorInfo
A program opened a dialog, a MsgBox or an InputBox, and the client that shows the program's dialogs answered it with something the dialog can't be answered
with, or the dialog couldn't reach that client at all. The program can't go on with that answer, so the run fails.
The program isn't at fault: its call was valid. The fault is the client's, or the connection's. That's why the error is RD-VBA's own, and not VBA's error 5 ("Invalid procedure call or argument"), which would blame the program.
The error is untrappable. The run fails whatever error handler the program has: On Error Resume Next doesn't swallow it, and On Error GoTo doesn't
reach its handler. A program that goes on with an answer nobody gave it does something nobody chose.
Why it doesn't show a dialog instead
A program that a client runs runs in the environment host, which the language server starts in the background. Nobody sees the host's own windows. Before this error existed, an answer the dialog couldn't have made the host show the platform's dialog, and the run waited on a window nobody could close. A client that shows a program's dialogs is the one that answers them: when its answer can't be used, the run fails and says why.
A host that no client relays dialogs for still shows the platform's own dialog.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
A MsgBox answered with a button it doesn't have |
MsgBox "Done" (a vbOKOnly box) answered with vbYes (6) |
The client answers with one of the box's buttons: vbOKOnly has vbOK (1) only. The message names the client, the box's buttons and the answer. |
| A dialog that couldn't be relayed to the client | The connection to the language server was lost while the program ran | Run the program again once the client is connected. |
A client that shows dialogs and doesn't answer one at all declined it. That's VBR50001 (nobody to answer), not this error.
The number
RD-VBA's own run-time errors are numbered VBR50000 to VBR50999. They are errors MS-VBA has no number for. The family follows whoever raised the error
(RD-VBAL §2.6.3): a program's own Err.Raise 50002 is the application error VBA50002, and it is never this one.
See also
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca