Alt-Tab works differently if Form called from Menu or Buttonbar Icon

  • Thread starter Thread starter seisman
  • Start date Start date
S

seisman

If you use the OnAction property of a Menu control to call a routine
that Shows a Form then use Alt-Tab to move between running programs the
Form and all of the Excel window and are visible when you return to
Excel. If you call the same routine from an Icon on a button bar only
the Form is visible when you get back to Excel, the Excel window is not
visible and the form appears in front of the last program window
visited. Can any one explain this? Is there a way of preventing it?
Seiscons
 
to get back to excel... try following
on error needed to handle both modal and modeless forms...


Private Sub CommandButton2_Click()
On Error Resume Next

AppActivate Application.Caption
AppActivate Me.Caption
End Sub

NOTE: windows has a setting determining if applications
can "steal focus" (see TweakUI)

it may not be enough if both excel and the other APP
are maximized..



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


seisman wrote :
 
Thanks, I'll give it a try but for the situation where this causes me
the most grief I am using an invisible form; there's nowhere to put the
button! Anyway I can dispense with the button bar icon in this case
and use only the menu. I'll have a look at that windows setting too.
Seisman
 
yep saw that post too...

playing with SetWindowLong ?

be aware that making a form invisible doesnt make it modal.

using (generic object) variables to refer to your forms.
makes it easier to prevent "double loading"

also:
ever checked the userforms collection in VBA?


if you want send me the workbook
and I'll review the code to see where you "go wrong" :)

i'll be signing off soon, but I'll have a look
ltr tonite.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


seisman wrote :
 
Back
Top