Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Alt-Tab works differently if Form called from Menu or Buttonbar Icon

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Alt-Tab works differently if Form called from Menu or Buttonbar Icon

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

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

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 :

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Alt-Tab works differently if Form called from Menu or Buttonbar Icon

Thanks.
The code is in a pretty big Add-in so I strip it out into a simple demo
workbook to illustrate the problems I'm having. How do I send you the
file?

In reply to your points:
Yes I'm aware that making the form invisible doesnt make it moda.
I do use generic object variable to refer to my forms.
No, never checked out the userforms collection; I'll have a look.

Seisman,



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

pls zip and email to address in my sig.
(just add @ and . around chello)

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


seisman wrote :

Thanks.
The code is in a pretty big Add-in so I strip it out into a simple
demo workbook to illustrate the problems I'm having. How do I send
you the file?

In reply to your points:
Yes I'm aware that making the form invisible doesnt make it moda.
I do use generic object variable to refer to my forms.
No, never checked out the userforms collection; I'll have a look.

Seisman,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro works differently on different computers, same version of Ex oscardwilde Excel Discussion (Misc queries) 6 December 28th 05 11:22 PM
macro works differently when using the Step Into (F8) feature Dave Y[_4_] Excel Programming 1 June 24th 05 03:06 AM
icon in menu toolbar roland Excel Programming 1 November 20th 03 01:29 PM
2 buttonbar questions Tom Ogilvy Excel Programming 0 August 2nd 03 04:55 PM
Data form Dates wrong when called from macro? brym Excel Programming 0 July 29th 03 07:08 PM


All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"