J678


My Macro doesn't bring my userform to the front because it has just transfered focus to Internet Explorer. Instead the Taskbar flashes repeatedly. the code is simple:

Set MyObject = CreateObject("internetexplorer.application")
With MyObject

.Visible = False
.Navigate MyLocation

Do While .ReadyState <> 4: Loop
End With

Load UserForm1

UserForm1.Show

What code do i write to bring Excel back to the focus and present the userform "on top"

PLEASE HELP!




Re: Change Input Focus: bring Form to front:Stop Excel from flashing: HELP!

Bruno Yu - MSFT


Move the thread from Visual Basic General. There are more exports on Visual Basic for Applications in this forum. I believe you are able to get the satisfying answers.

If you have any questions in VB6, please post the thread in the following links:

  • Visual Basic 6 Newgroups
  • Visual Basic 6.0 on MSDN Library
  • MSDN Visual Basic 6.0 Resource Center
  • VB City
  • VB-Helper
  • VB Forums
  • CodeGuru
  • Code Project
  • Planet Source Code

    Thanks again for your question.







  • Re: Change Input Focus: bring Form to front:Stop Excel from flashing: HELP!

    jameswmc

    IRONIC!!!!

    I have exactly the opposite problem. I can't get the IE window to stay on top.

    However, after trying it your way, IT WORKED!!

    Here is your answer..

    UserForm1.Show vbModeless

    Leave out the Load UserForm1 part.

    I think you can also just leave the vbModeless out and put 1. vbModeless just allows you to click outside the userform, or run other macros while it is showing.

    I hope that MSDN will allow my post, as it would be greatly appreciated since such a problem is hard to find a solution to, I've been looking for a while.

    Thanks,

    Wade