Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Loading Web Page Issue

I am loading a web page using the following piece of code. I'm sure I got it
from someone somewhere.

Sub LoadWebPage(myIE As SHDocVw.InternetExplorer, _
myURL As String)
If myIE Is Nothing Then
Set myIE = GetNewIE
End If
myIE.Visible = True

With myIE
'open page
.Navigate myURL
'wait until IE finished loading the page
Do While .ReadyState < READYSTATE_COMPLETE
Application.Wait Now + TimeValue("0:00:01")
Loop

End With
myIE.Quit

End Sub

Function GetNewIE() As SHDocVw.InternetExplorer
'create new IE instance
Set GetNewIE = New SHDocVw.InternetExplorer
'start with a blank page
GetNewIE.Navigate2 "about:Blank"

GetNewIE.Visible = True

'GetNewIE.FullScreen = True 'So we don't copy the header
End Function


If the URL is http:// ... it will quit, but if the URL is something like
"T:", it won't quit, but also doesn't have an error. Can anyone give me
some idea how to address this?

Thanks,

Barb Reinhardt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Loading Web Page Issue

Just discovered something

With myIE
'open page
.Navigate myURL 'If myURL = "T:", a new IE Window is opened.
'wait until IE finished loading the page
Debug.Print myIE.LocationURL
Do While .ReadyState < READYSTATE_COMPLETE
Application.Wait Now + TimeValue("0:00:01")
Loop

End With
myIE.Quit

--
HTH,

Barb Reinhardt



"Barb Reinhardt" wrote:

I am loading a web page using the following piece of code. I'm sure I got it
from someone somewhere.

Sub LoadWebPage(myIE As SHDocVw.InternetExplorer, _
myURL As String)
If myIE Is Nothing Then
Set myIE = GetNewIE
End If
myIE.Visible = True

With myIE
'open page
.Navigate myURL
'wait until IE finished loading the page
Do While .ReadyState < READYSTATE_COMPLETE
Application.Wait Now + TimeValue("0:00:01")
Loop

End With
myIE.Quit

End Sub

Function GetNewIE() As SHDocVw.InternetExplorer
'create new IE instance
Set GetNewIE = New SHDocVw.InternetExplorer
'start with a blank page
GetNewIE.Navigate2 "about:Blank"

GetNewIE.Visible = True

'GetNewIE.FullScreen = True 'So we don't copy the header
End Function


If the URL is http:// ... it will quit, but if the URL is something like
"T:", it won't quit, but also doesn't have an error. Can anyone give me
some idea how to address this?

Thanks,

Barb Reinhardt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Loading Web Page Issue

I figured it out. Thanks anyway.

Barb Reinhardt



"Barb Reinhardt" wrote:

Just discovered something

With myIE
'open page
.Navigate myURL 'If myURL = "T:", a new IE Window is opened.
'wait until IE finished loading the page
Debug.Print myIE.LocationURL
Do While .ReadyState < READYSTATE_COMPLETE
Application.Wait Now + TimeValue("0:00:01")
Loop

End With
myIE.Quit

--
HTH,

Barb Reinhardt



"Barb Reinhardt" wrote:

I am loading a web page using the following piece of code. I'm sure I got it
from someone somewhere.

Sub LoadWebPage(myIE As SHDocVw.InternetExplorer, _
myURL As String)
If myIE Is Nothing Then
Set myIE = GetNewIE
End If
myIE.Visible = True

With myIE
'open page
.Navigate myURL
'wait until IE finished loading the page
Do While .ReadyState < READYSTATE_COMPLETE
Application.Wait Now + TimeValue("0:00:01")
Loop

End With
myIE.Quit

End Sub

Function GetNewIE() As SHDocVw.InternetExplorer
'create new IE instance
Set GetNewIE = New SHDocVw.InternetExplorer
'start with a blank page
GetNewIE.Navigate2 "about:Blank"

GetNewIE.Visible = True

'GetNewIE.FullScreen = True 'So we don't copy the header
End Function


If the URL is http:// ... it will quit, but if the URL is something like
"T:", it won't quit, but also doesn't have an error. Can anyone give me
some idea how to address this?

Thanks,

Barb Reinhardt

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
Custom Toolbar Loading issue Bishop Excel Programming 2 June 2nd 09 08:35 PM
Loading a Different Page Robert Maddox Excel Discussion (Misc queries) 0 October 20th 06 07:16 PM
addin loading issue howiefan Excel Discussion (Misc queries) 3 December 1st 04 11:10 PM
Loading a web page on a web browser control Aaron[_10_] Excel Programming 4 January 6th 04 01:11 PM
Web page loading Matt Cohen Excel Programming 4 October 3rd 03 07:31 PM


All times are GMT +1. The time now is 01:32 PM.

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"