Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default In VBA, make IE Browser object always in foreground

I use VBA to create an IE Browser object using code shown below.
Sometimes the browser comes up minimized and shows flashing in the task bar
at the bottom of the screen due to other activities on the screen.

I need to have the ie object always visible. Is there a command I can use
to make this happen ?


Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = ScreenWidth * 0.55 ' 600
ie.Height = ScreenHeight * 0.98 '750
ie.Left = 0
ie.Top = 0

Thanks,

Gary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default In VBA, make IE Browser object always in foreground

You need to add

IE.Visible = True

to make the browser visible in the first place. To keep the
browser visible within Excel, allowing you to switch between IE
and Excel without losing the browser, you need to use the
SetParent API call.

In the declarations area of your module (above and outside of any
procedure), declare the SetParent function.

Declare Function SetParent Lib "user32" (ByVal hWndChild As Long,
_
ByVal hWndNewParent As Long) As Long

Then, in your procedure, use code like

IE.Visible = True
SetParent IE.Hwnd, Application.Hwnd

This will make IE a child window of the Excel application, and IE
will float above the worksheet.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
I use VBA to create an IE Browser object using code shown below.
Sometimes the browser comes up minimized and shows flashing in
the task bar
at the bottom of the screen due to other activities on the
screen.

I need to have the ie object always visible. Is there a
command I can use
to make this happen ?


Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = ScreenWidth * 0.55 ' 600
ie.Height = ScreenHeight * 0.98 '750
ie.Left = 0
ie.Top = 0

Thanks,

Gary



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default In VBA, make IE Browser object always in foreground

Hi Chip,

Your suggestion worked great with one small mod. I had to Add €śPrivate€ť in
front of the declare SetParent function so as to not get the €ś..Declare
statements not allowed as public members of object modules€ť error. I dont
understand what this message is telling me. But your suggest worked great.

Many thanks,

Gary
decalre teh

"Chip Pearson" wrote:

You need to add

IE.Visible = True

to make the browser visible in the first place. To keep the
browser visible within Excel, allowing you to switch between IE
and Excel without losing the browser, you need to use the
SetParent API call.

In the declarations area of your module (above and outside of any
procedure), declare the SetParent function.

Declare Function SetParent Lib "user32" (ByVal hWndChild As Long,
_
ByVal hWndNewParent As Long) As Long

Then, in your procedure, use code like

IE.Visible = True
SetParent IE.Hwnd, Application.Hwnd

This will make IE a child window of the Excel application, and IE
will float above the worksheet.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
I use VBA to create an IE Browser object using code shown below.
Sometimes the browser comes up minimized and shows flashing in
the task bar
at the bottom of the screen due to other activities on the
screen.

I need to have the ie object always visible. Is there a
command I can use
to make this happen ?


Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = ScreenWidth * 0.55 ' 600
ie.Height = ScreenHeight * 0.98 '750
ie.Left = 0
ie.Top = 0

Thanks,

Gary




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default In VBA, make IE Browser object always in foreground

In class modules, Sheet modules, and the ThisWorkbook module,
function declares may not be Public. You must declare them as
Private. Just one of the rules of the road.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
Hi Chip,

Your suggestion worked great with one small mod. I had to Add
"Private" in
front of the declare SetParent function so as to not get the
"..Declare
statements not allowed as public members of object modules"
error. I don't
understand what this message is telling me. But your suggest
worked great.

Many thanks,

Gary
decalre teh

"Chip Pearson" wrote:

You need to add

IE.Visible = True

to make the browser visible in the first place. To keep the
browser visible within Excel, allowing you to switch between
IE
and Excel without losing the browser, you need to use the
SetParent API call.

In the declarations area of your module (above and outside of
any
procedure), declare the SetParent function.

Declare Function SetParent Lib "user32" (ByVal hWndChild As
Long,
_
ByVal hWndNewParent As Long) As Long

Then, in your procedure, use code like

IE.Visible = True
SetParent IE.Hwnd, Application.Hwnd

This will make IE a child window of the Excel application, and
IE
will float above the worksheet.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
I use VBA to create an IE Browser object using code shown
below.
Sometimes the browser comes up minimized and shows flashing
in
the task bar
at the bottom of the screen due to other activities on the
screen.

I need to have the ie object always visible. Is there a
command I can use
to make this happen ?


Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = ScreenWidth * 0.55 ' 600
ie.Height = ScreenHeight * 0.98 '750
ie.Left = 0
ie.Top = 0

Thanks,

Gary






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default In VBA, make IE Browser object always in foreground

Chip,

I noticed that although the IE browser is on top, I can not move it or
adjust the scroll bars. If I comment out the €śSetParent IE.Hwnd,
Application.Hwnd€ť then I can move the window and adjust the scroll bars.

Is it possible to have the browser window on top AND still be able to
control the scroll bars and move the window.

Hope this makes sense,

Gary


"Chip Pearson" wrote:

In class modules, Sheet modules, and the ThisWorkbook module,
function declares may not be Public. You must declare them as
Private. Just one of the rules of the road.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
Hi Chip,

Your suggestion worked great with one small mod. I had to Add
"Private" in
front of the declare SetParent function so as to not get the
"..Declare
statements not allowed as public members of object modules"
error. I don't
understand what this message is telling me. But your suggest
worked great.

Many thanks,

Gary
decalre teh

"Chip Pearson" wrote:

You need to add

IE.Visible = True

to make the browser visible in the first place. To keep the
browser visible within Excel, allowing you to switch between
IE
and Excel without losing the browser, you need to use the
SetParent API call.

In the declarations area of your module (above and outside of
any
procedure), declare the SetParent function.

Declare Function SetParent Lib "user32" (ByVal hWndChild As
Long,
_
ByVal hWndNewParent As Long) As Long

Then, in your procedure, use code like

IE.Visible = True
SetParent IE.Hwnd, Application.Hwnd

This will make IE a child window of the Excel application, and
IE
will float above the worksheet.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
I use VBA to create an IE Browser object using code shown
below.
Sometimes the browser comes up minimized and shows flashing
in
the task bar
at the bottom of the screen due to other activities on the
screen.

I need to have the ie object always visible. Is there a
command I can use
to make this happen ?


Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = ScreenWidth * 0.55 ' 600
ie.Height = ScreenHeight * 0.98 '750
ie.Left = 0
ie.Top = 0

Thanks,

Gary









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default In VBA, make IE Browser object always in foreground

I can't replicate your problem The code I provided works fine in
Excel 2003 and IE 6.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"gary" wrote in message
...
Chip,

I noticed that although the IE browser is on top, I can not
move it or
adjust the scroll bars. If I comment out the "SetParent
IE.Hwnd,
Application.Hwnd" then I can move the window and adjust the
scroll bars.

Is it possible to have the browser window on top AND still be
able to
control the scroll bars and move the window.

Hope this makes sense,

Gary


"Chip Pearson" wrote:

In class modules, Sheet modules, and the ThisWorkbook module,
function declares may not be Public. You must declare them as
Private. Just one of the rules of the road.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
Hi Chip,

Your suggestion worked great with one small mod. I had to
Add
"Private" in
front of the declare SetParent function so as to not get the
"..Declare
statements not allowed as public members of object modules"
error. I don't
understand what this message is telling me. But your
suggest
worked great.

Many thanks,

Gary
decalre teh

"Chip Pearson" wrote:

You need to add

IE.Visible = True

to make the browser visible in the first place. To keep the
browser visible within Excel, allowing you to switch
between
IE
and Excel without losing the browser, you need to use the
SetParent API call.

In the declarations area of your module (above and outside
of
any
procedure), declare the SetParent function.

Declare Function SetParent Lib "user32" (ByVal hWndChild As
Long,
_
ByVal hWndNewParent As Long) As Long

Then, in your procedure, use code like

IE.Visible = True
SetParent IE.Hwnd, Application.Hwnd

This will make IE a child window of the Excel application,
and
IE
will float above the worksheet.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"gary" wrote in message
...
I use VBA to create an IE Browser object using code shown
below.
Sometimes the browser comes up minimized and shows
flashing
in
the task bar
at the bottom of the screen due to other activities on
the
screen.

I need to have the ie object always visible. Is there a
command I can use
to make this happen ?


Set ie = CreateObject("InternetExplorer.Application")
ie.AddressBar = False
ie.MenuBar = False
ie.Toolbar = False
ie.Width = ScreenWidth * 0.55 ' 600
ie.Height = ScreenHeight * 0.98 '750
ie.Left = 0
ie.Top = 0

Thanks,

Gary









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA and Object Browser Help Missing Lee Setting up and Configuration of Excel 0 March 13th 06 10:02 PM
Object Browser does what? davegb Excel Programming 6 June 27th 05 06:12 PM
Object Browser Help [email protected] Excel Programming 0 January 6th 05 08:19 PM
Object Browser Help [email protected] Excel Programming 0 January 6th 05 08:18 PM
VBA Object Browser icons key dannyraw Excel Programming 1 October 14th 04 05:08 PM


All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"