View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Modeless form keeps taking 'focus'

Maybe you can cheat just a little.

I put this under the userform:

Option Explicit
Private Sub UserForm_Initialize()
Application.OnTime Now + TimeSerial(0, 0, 1), "SelectACell"
End Sub

And this in a general module:
Option Explicit
Sub testme()
UserForm1.Show False
End Sub
Sub SelectACell()
AppActivate Application.Caption
End Sub

It seemed to work ok in my simple testing.


Michelle wrote:

I'm using a modeless form in Excel 2007, I want to be able to scroll around
Excel and occasionally select something from the form. But when I use the
form, the form gets 'focus' and things (like the mouse-wheel) don't apply to
the application anymore.

Is there a way to hand focus back to the application? Or is there a way so
set the form so that it doesn't take this 'focus'?

Thanks

Michelle


--

Dave Peterson