Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Internet explorer object questions

Is it better to go ...
Dim ie As InternetExplorer
Set ie = New InternetExplorer
or
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")

I had been using the former, but now I see examples in texts of the latter.
Here is another ...

It it better to go ...
Do
Loop Until ie.ReadyState = READYSTATE_COMPLETE
or
Do While ie.Busy
Loop

And is a 'DoEvents' useful in the Do loop?

Does ie.Silent keep the 'You are now exiting a secure web page' box from
popping up?

Thanks very much for your input!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Internet explorer object questions

1) you're question refers to what is called early binding - where you dim a
variable explicitly, and late binding, where the variable is an object. Early
binding has several advantages. The developer is able to use intellisense ie
the objects properties and methods are exposed at design time, and
compilation is faster making more compact code...the compiler knows what the
object is. Late binding of course means that without a specific type, there's
no intellisense and the compiler has to allow extra memory etc. The biggest
advantage I see for late binding is that for applications like Excel, the
createobject method doesn't care where the app is installed.

2) use DoEvents .... it releases control back to the O/S so that other
processes and interrupts can get picked up and processed.

3) For what its worth, if you us eth eie object in a standard module you
lose any abilitu to use events, I suggest that you use the Dim WithEvents in
say a class module ( a userform is also a type of class module). This way,
when you ie object fires events like page loaded, yousr code can trap it and
react accordingly.

HTH
Patrick Molloy
Microsoft Excel MVP


"Tim Coddington" wrote:

Is it better to go ...
Dim ie As InternetExplorer
Set ie = New InternetExplorer
or
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")

I had been using the former, but now I see examples in texts of the latter.
Here is another ...

It it better to go ...
Do
Loop Until ie.ReadyState = READYSTATE_COMPLETE
or
Do While ie.Busy
Loop

And is a 'DoEvents' useful in the Do loop?

Does ie.Silent keep the 'You are now exiting a secure web page' box from
popping up?

Thanks very much for your input!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Internet explorer object questions

Great. My thanks.
I guess I am able to use the early binding then, since I always know where I
am installed.
Dim ie As InternetExplorer
Set ie = New InternetExplorer
and
do
DoEvents
loop

Is ie.Busy basically the same as ie.ReadyState = READYSTATE_COMPLETE?
Does ie.Silent keep the 'You are now exiting a secure web page' box from
popping up?


Item 3) brings me to my next question; how to trap the NewWindow2 event.
Never built a class module yet, and don't belive I'm free to use a userform,
so I've got some reading to do. Thanks much. Great group!

"Patrick Molloy" wrote in message
...
1) you're question refers to what is called early binding - where you dim

a
variable explicitly, and late binding, where the variable is an object.

Early
binding has several advantages. The developer is able to use intellisense

ie
the objects properties and methods are exposed at design time, and
compilation is faster making more compact code...the compiler knows what

the
object is. Late binding of course means that without a specific type,

there's
no intellisense and the compiler has to allow extra memory etc. The

biggest
advantage I see for late binding is that for applications like Excel, the
createobject method doesn't care where the app is installed.

2) use DoEvents .... it releases control back to the O/S so that other
processes and interrupts can get picked up and processed.

3) For what its worth, if you us eth eie object in a standard module you
lose any abilitu to use events, I suggest that you use the Dim WithEvents

in
say a class module ( a userform is also a type of class module). This

way,
when you ie object fires events like page loaded, yousr code can trap it

and
react accordingly.

HTH
Patrick Molloy
Microsoft Excel MVP


"Tim Coddington" wrote:

Is it better to go ...
Dim ie As InternetExplorer
Set ie = New InternetExplorer
or
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")

I had been using the former, but now I see examples in texts of the

latter.
Here is another ...

It it better to go ...
Do
Loop Until ie.ReadyState = READYSTATE_COMPLETE
or
Do While ie.Busy
Loop

And is a 'DoEvents' useful in the Do loop?

Does ie.Silent keep the 'You are now exiting a secure web page' box from
popping up?

Thanks very much for your input!





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
Internet Explorer da Excel Discussion (Misc queries) 4 October 9th 08 09:31 PM
internet explorer instance Manoj Excel Discussion (Misc queries) 0 February 1st 06 09:56 AM
Internet explorer download/XP Pro?? Maxwell-5000 Excel Discussion (Misc queries) 1 January 3rd 06 10:03 PM
Internet explorer problem Dave Peterson Excel Discussion (Misc queries) 0 January 24th 05 11:02 PM
internet explorer doris Excel Discussion (Misc queries) 1 January 5th 05 09:44 PM


All times are GMT +1. The time now is 12:58 AM.

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

About Us

"It's about Microsoft Excel"