i created a userform (call it userform1) that launches another userform (call this userform2). excel is hidden from user's view (by application.visible = false) upon launching userform1 (modal) so only the userforms are visible.
i wanted userform2 to hide or unload when i press the "{ESC}" button (escape key).

i tried:
1.) putting a command button (call it "Hidekey") setting it to default key and code it to close the userform2 (works but not ideal closing userform2 with the enter key on keyboard)

2.) assign an accelerator key ("H") on hidekey
(not ideal closing userform2 with two buttons to press - Alt+H)

3.) run code: (on initializing userform1)
application.onkey "{ESC}", "CloseME"
sub CloseME()
userform2.hide
end sub
-(the code above is not the accurate code) i made this one work, BUT, it only works when excel is Visible from user's view - pointless


so..
has anyone tried assigning like escape key to close a userform while excel is not visible (only the userform is visible) if yes, please help...
Or.. Does anyone have a better idea...