Forum Discussion
VBA Form Command Button not working
"creating a single form command button to general [generate?] a VBA MsgBox fails to work."
That's a bit vague. Are you attempting to create a form (UserForm) that the user will interact with, which will contain this command button? Or are you attempting to place a (form) command button on a worksheet? (Or possibly both.)
In the former case, your MsgBox statement will go into the Click event handler for the button you create. That event handler will be part of the code module for the form. (What user action do you intend to occur to cause the form to be displayed? The click of a button on a worksheet? A particular change to a particular cell value? Some other user action?)
In the latter case, your MsgBox statement will go into a macro for the button you create. That macro is part of a standard code module (which Microsoft ambiguously calls just a module, but there can exist: standard code modules not associated with any particular worksheet, worksheet code modules, workbook code modules, userform modules, class modules…). (Excel would have prompted you for the name of the macro as soon as you created the button.)
Here's how the Project Explorer window (a child of the VB Editor window) might appear. (Solver is an add-in that you might not be using; it is not required for this problem.)
Edit: Oh, and are you using Excel for Windows, or Excel for Mac?
I have abandoned all efforts of creating an input form and just focussed on trying to get a form based on one single command button to cause a message box to appear on screen when the button is clicked.
As I detailed before, I have tried pretty much every standard solution found by googling the issue. None of them have worked except using RegEdit to delete Excel's key folder HKEY_CURRET_USER. That at least restored one of the two Security Risk messages appearing when first attempting to use VBA in a workbook.
I'm sorry to say, SnowMan55, your comments and directions fail to address the point of my inquiry. I'm thinking now, I probably need to "factory reset" MS Office's key folder from under HKEY_CURRET_USER.