Back again,
I'm wanting to launch a web browser from an excel worksheet. I've got some code that _mostly_ works...
I'd like the window to pop on top, even if another browser is running minimized. When I run this code, I don't always get the new window to pop up, sometimes I just get the nice glowing icon at the bottom that indicates something needs attention. Is there some sort of "on top" flag I can define?Sub Button_PS_Login() Dim Site As Object Set Site = CreateObject("InternetExplorer.application") Site.Visible = True Site.Navigate "http://www.cnn.com" End Sub
Thanks!
Hello GordonPSmith,
This will automatically maximize the window after Internet Explorer is tarted.
' This line must appear above before any Sub or Function statements in the VBA module. Private Declare Function ShowWindow Lib "User32.dll" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long Sub Button_PS_Login() Dim Site As Object Set Site = CreateObject("InternetExplorer.application") Site.Visible = True Site.Navigate "http://www.cnn.com" ShowWindow Site.hWnd, 3 End Sub
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
I don't know what 'tarting' is(only a wild guess) but:
Sub snb() With CreateObject("InternetExplorer.application") .Visible = True .FullScreen = True .Navigate "http://www.cnn.com" End With End Sub
Last edited by snb; 01-06-2012 at 02:57 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks