Archive of Mr Excel Message Board


Back to Excel VBA archive index
Back to archive home



returning focus to Excel

Posted by mike faulkner on September 18, 2000 9:19 AM
I need to be able to return the focus to Excel in response to certain events in a userform.

Please look at this file if you don't know what I mean. I think it only works in Excel2000 because it contains a non-modal userform.

(broken link)

PS: I a similar question a while back and Ivan recommended they look at the application.inputbox documentation - I've been all over the help files and Microsoft site and haven't found anything.


Check out our Excel VBA Resources

Re: returning focus to Excel

Posted by Ivan Moala on September 18, 0100 3:11 PM


Mike, use AppActivate eg.

Private Sub CommandButton1_Click()
AppActivate "Microsoft excel"
End Sub


HTH

Ivan


Re: returning focus to Excel

Posted by mike faulkner on September 18, 0100 9:42 PM

Hey that works great! I can't thank you enough.

Mike




This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.