maximize Internet Explorer from Excel

catalpa

New Member
Joined
Jun 13, 2004
Messages
11
Hello,

Does anyone know how to open Internet Explorer from Excel and automatically maximize? I can do this:

vURL = Worksheets("Sheet1").Range("B12").Value

If vURL = "" Then vURL = "http://www.google.com"

Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = 1
objIE.Fullscreen = 1

objIE.navigate vURL

However, using fullscreen here causes all of the menu bars, etc. to disappear. I tried

Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = 1
objIE.Fullscreen = 1
objIE.MenuBar = 1
objIE.resizable = 1
objIE.ScrollBars = 1
objIE.titleBar = 1
objIE.Toolbar = 1

but I get error messages. The window will need to adjust to the screen resolution of the person maximizing it -- I can't just set height and width. Can anyone help with this?

Thanks,

Catalpa
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try something like this:

At the top of the code window (outside any subs) enter
Code:
Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" _
            (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Global Const SW_MAXIMIZE = 3
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2

Then in your sub procedure, use something like this:
Code:
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = 1
apiShowWindow objIE.hwnd, SW_MAXIMIZE

I used information about working with the Access window, and just applied to the IE window, from this link:

http://support.microsoft.com/?kbid=210118

HTH,
Mike.
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,792
Members
448,994
Latest member
rohitsomani

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top