Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Reference to IE - but none found?

I have some code, I think developed for Excel 97 that requires a reference to
MS Internet Explorer. The problem is, I don't have a library for IE. Has it
been changed? Can I download it from somewhere?

OR, better still, can someone update the following code for XP?

Sub FindImages(sURL As String)

Dim oDoc As New MSHTML.HTMLDocument
Dim IE As New InternetExplorer
Dim i As Integer

IE.navigate sURL
Do While IE.readyState < READYSTATE_COMPLETE
Loop
Set oDoc = IE.Document
For i = 1 To oDoc.images.Length
If oDoc.images(i - 1).src Like "http://ichart.yahoo.com/*" Then
saveImg oDoc.images(i - 1).src, ThisWorkbook.Path & "\temp.png"
End If
Next i
Set oDoc = Nothing
Set IE = Nothing
End Sub

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Reference to IE - but none found?

Hi quartz,

The reference you need for the InternetExplorer object is "Microsoft
Internet Controls". Or you could use Late Binding by declaring both object
variables As Object and using CreateObject instead of the New keyword. If
you decide to use Late Binding, you'll also have to replace the constant
READYSTATE_COMPLETE with its literal value, which is 4.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


quartz wrote:
I have some code, I think developed for Excel 97 that requires a
reference to MS Internet Explorer. The problem is, I don't have a
library for IE. Has it been changed? Can I download it from somewhere?

OR, better still, can someone update the following code for XP?

Sub FindImages(sURL As String)

Dim oDoc As New MSHTML.HTMLDocument
Dim IE As New InternetExplorer
Dim i As Integer

IE.navigate sURL
Do While IE.readyState < READYSTATE_COMPLETE
Loop
Set oDoc = IE.Document
For i = 1 To oDoc.images.Length
If oDoc.images(i - 1).src Like "http://ichart.yahoo.com/*" Then
saveImg oDoc.images(i - 1).src, ThisWorkbook.Path & "\temp.png"
End If
Next i
Set oDoc = Nothing
Set IE = Nothing
End Sub

Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Reference to IE - but none found?

Whoa! Thanks Jake.

This sub calls another as follows:

Sub saveImg(sURL As String, sPath As String)

Dim oXHTTP As New MSXML2.XMLHTTP
Dim oStream As New ADODB.Stream
Dim oFSO As New Scripting.FileSystemObject
oXHTTP.Open "GET", sURL, False
oXHTTP.send
oStream.Type = adTypeBinary
oStream.Open
oStream.Write oXHTTP.responseBody
oStream.SaveToFile sPath, adSaveCreateOverWrite
oStream.Close
Set oXHTTP = Nothing
Set oStream = Nothing
Set oFSO = Nothing

End Sub

Can you tell me where I could find illustrative examples on how to code
using "Streams" and IE?

Again thanks for the assistance.

"Jake Marx" wrote:

Hi quartz,

The reference you need for the InternetExplorer object is "Microsoft
Internet Controls". Or you could use Late Binding by declaring both object
variables As Object and using CreateObject instead of the New keyword. If
you decide to use Late Binding, you'll also have to replace the constant
READYSTATE_COMPLETE with its literal value, which is 4.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


quartz wrote:
I have some code, I think developed for Excel 97 that requires a
reference to MS Internet Explorer. The problem is, I don't have a
library for IE. Has it been changed? Can I download it from somewhere?

OR, better still, can someone update the following code for XP?

Sub FindImages(sURL As String)

Dim oDoc As New MSHTML.HTMLDocument
Dim IE As New InternetExplorer
Dim i As Integer

IE.navigate sURL
Do While IE.readyState < READYSTATE_COMPLETE
Loop
Set oDoc = IE.Document
For i = 1 To oDoc.images.Length
If oDoc.images(i - 1).src Like "http://ichart.yahoo.com/*" Then
saveImg oDoc.images(i - 1).src, ThisWorkbook.Path & "\temp.png"
End If
Next i
Set oDoc = Nothing
Set IE = Nothing
End Sub

Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Reference to IE - but none found?

Hi quartz,

I don't know of any resources offhand (besides the MSDN/MS sites). My
understanding of XMLHTTP code came mainly from results of Google searches.
It's a popular technology for the ASP folks, so you may want to look around
some ASP sites for more examples.

Here's an example I posted back in June 2002 that does a generic file copy
over HTTP, if it helps any:

http://groups-beta.google.com/group/...93dbf506ee96fd

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


quartz wrote:
Whoa! Thanks Jake.

This sub calls another as follows:

Sub saveImg(sURL As String, sPath As String)

Dim oXHTTP As New MSXML2.XMLHTTP
Dim oStream As New ADODB.Stream
Dim oFSO As New Scripting.FileSystemObject
oXHTTP.Open "GET", sURL, False
oXHTTP.send
oStream.Type = adTypeBinary
oStream.Open
oStream.Write oXHTTP.responseBody
oStream.SaveToFile sPath, adSaveCreateOverWrite
oStream.Close
Set oXHTTP = Nothing
Set oStream = Nothing
Set oFSO = Nothing

End Sub

Can you tell me where I could find illustrative examples on how to
code using "Streams" and IE?

Again thanks for the assistance.

"Jake Marx" wrote:

Hi quartz,

The reference you need for the InternetExplorer object is "Microsoft
Internet Controls". Or you could use Late Binding by declaring both
object variables As Object and using CreateObject instead of the New
keyword. If you decide to use Late Binding, you'll also have to
replace the constant READYSTATE_COMPLETE with its literal value,
which is 4.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


quartz wrote:
I have some code, I think developed for Excel 97 that requires a
reference to MS Internet Explorer. The problem is, I don't have a
library for IE. Has it been changed? Can I download it from
somewhere?

OR, better still, can someone update the following code for XP?

Sub FindImages(sURL As String)

Dim oDoc As New MSHTML.HTMLDocument
Dim IE As New InternetExplorer
Dim i As Integer

IE.navigate sURL
Do While IE.readyState < READYSTATE_COMPLETE
Loop
Set oDoc = IE.Document
For i = 1 To oDoc.images.Length
If oDoc.images(i - 1).src Like "http://ichart.yahoo.com/*" Then
saveImg oDoc.images(i - 1).src, ThisWorkbook.Path &
"\temp.png" End If
Next i
Set oDoc = Nothing
Set IE = Nothing
End Sub

Thanks in advance.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Reference to IE - but none found?

Okay. Thanks again.

"Jake Marx" wrote:

Hi quartz,

I don't know of any resources offhand (besides the MSDN/MS sites). My
understanding of XMLHTTP code came mainly from results of Google searches.
It's a popular technology for the ASP folks, so you may want to look around
some ASP sites for more examples.

Here's an example I posted back in June 2002 that does a generic file copy
over HTTP, if it helps any:

http://groups-beta.google.com/group/...93dbf506ee96fd

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


quartz wrote:
Whoa! Thanks Jake.

This sub calls another as follows:

Sub saveImg(sURL As String, sPath As String)

Dim oXHTTP As New MSXML2.XMLHTTP
Dim oStream As New ADODB.Stream
Dim oFSO As New Scripting.FileSystemObject
oXHTTP.Open "GET", sURL, False
oXHTTP.send
oStream.Type = adTypeBinary
oStream.Open
oStream.Write oXHTTP.responseBody
oStream.SaveToFile sPath, adSaveCreateOverWrite
oStream.Close
Set oXHTTP = Nothing
Set oStream = Nothing
Set oFSO = Nothing

End Sub

Can you tell me where I could find illustrative examples on how to
code using "Streams" and IE?

Again thanks for the assistance.

"Jake Marx" wrote:

Hi quartz,

The reference you need for the InternetExplorer object is "Microsoft
Internet Controls". Or you could use Late Binding by declaring both
object variables As Object and using CreateObject instead of the New
keyword. If you decide to use Late Binding, you'll also have to
replace the constant READYSTATE_COMPLETE with its literal value,
which is 4.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


quartz wrote:
I have some code, I think developed for Excel 97 that requires a
reference to MS Internet Explorer. The problem is, I don't have a
library for IE. Has it been changed? Can I download it from
somewhere?

OR, better still, can someone update the following code for XP?

Sub FindImages(sURL As String)

Dim oDoc As New MSHTML.HTMLDocument
Dim IE As New InternetExplorer
Dim i As Integer

IE.navigate sURL
Do While IE.readyState < READYSTATE_COMPLETE
Loop
Set oDoc = IE.Document
For i = 1 To oDoc.images.Length
If oDoc.images(i - 1).src Like "http://ichart.yahoo.com/*" Then
saveImg oDoc.images(i - 1).src, ThisWorkbook.Path &
"\temp.png" End If
Next i
Set oDoc = Nothing
Set IE = Nothing
End Sub

Thanks in advance.



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
Return worksheet name containing value found in 3D reference funct PKK Excel Worksheet Functions 8 November 15th 07 04:00 PM
Reference Cell if Found in a IF function A Stevens Excel Worksheet Functions 2 December 25th 05 05:27 PM
IF NOT FOUND roy.okinawa Excel Worksheet Functions 5 November 17th 05 03:26 AM
I found reference to info that I need on Excel-how do I acess the Rosered Charts and Charting in Excel 1 May 23rd 05 06:16 PM
How do I reference external data from a file, file name found in . Clux Excel Discussion (Misc queries) 1 February 10th 05 10:52 PM


All times are GMT +1. The time now is 12:47 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"