I am running VBA script to display a menu. There are a few command buttons, each selecting a different worksheet (I do locks/unlocks of select sheet) for user to work on. Once completed on the worksheet, I have a macro button on the worksheet that re-displays the menu: THIS WORKS I cannot get the worksheet to remain open on the screen: the whole program seems to STOP Code thus far: (I show what I've tried) This is 1-Commandbutton that should open a worksheet to work on the history data
Private Sub cmdRPTSRVHIST_Click()
Unload MAINMENU
`Deactivate MAINMENU`
`Close MAINMENU`
`Worksheets("QRYsrvHst").Select`
`ActiveSheet.Name = "QrysrvHST"`
Sheets("Qrysrvhst").Visible = True
Sheets("Qrysrvhst").Activate
MsgBox ("** what now????"), vbYesNo
`'** once I click OK on MSGBOX, the pgm stops (cannot see worksheet)`
`** seems to go back to programmer edit mode (ALT-F11)`
`NOTE: Calling/running pgm out of ALT-F11/F5-run - might this be an issue??`
End Sub
If you run a script from the VB Project editor, then the application returns to the editor after execution has ended. It won't happen when the user runs the script outside of the editor.