View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Alt-Tab works differently if Form called from Menu or Buttonbar Icon



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 :

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