Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default FileDateTime for Internet web page

Hi,

Can you get the Created/LastModified Date for an Internet web page?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FileDateTime for Internet web page


Hello

I hope this help you


Sub Informations_And_metaDatas_WebPage()
'michelxld le 11.05.2005
'activate Microsoft HTML Objects Library
'activate Microsoft Internet Controls
Dim IE As New InternetExplorer
Dim htmlDoc As HTMLDocument
Dim htmlRef As IHTMLMetaElement
Dim i As Byte

IE.Navigate "http://www.exceltip.com/"
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

Set htmlDoc = IE.Document
'informations
MsgBox htmlDoc.Title & vbLf & htmlDoc.fileCreatedDate & _
vbLf & htmlDoc.LastModified & vbLf & htmlDoc.fileSize & " octets ."

'metadatas in web Page ( description & keywords )
For i = 0 To 1
Set htmlRef = htmlDoc.all.tags("meta").Item(i)
MsgBox htmlRef.content
Next i

Set IE = Nothing
End Sub


Regards ,
miche

--
michelxl
-----------------------------------------------------------------------
michelxld's Profile: http://www.excelforum.com/member.php...fo&userid=1736
View this thread: http://www.excelforum.com/showthread.php?threadid=37484

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default FileDateTime for Internet web page

Hi Michael,

Thanks for the reply.

I was hoping for a means to check a webpage (or file from a web server)
creation/modified date, without having to open/brows the file.

Can your macro be altered to achieve this, or would you say such a
thing was undoable?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default FileDateTime for Internet web page

Hi Mogwai,

Mogwai wrote:
I was hoping for a means to check a webpage (or file from a web
server) creation/modified date, without having to open/brows the file.

Can your macro be altered to achieve this, or would you say such a
thing was undoable?


If you're talking about a web server to which you have direct access, then
you could probably do this with the FileSystemObject. Otherwise, for a
remote web page, you would have to make an HTTP request on the URL and
retrieve the header information in a way like michel demonstrated.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default FileDateTime for Internet web page

Hi Jake,

Thanks for this.

I would be talking about a remote web page, so don't have direct access
as such.

I am trying to get the Date/Time a page was up-loaded to a web server,
as I believe this to be the most accurate Date/Time (assuming the
Server clock is correct).

I know there is Javascript, that can alert the Date/Time for a page and
the Properties of a page can also show Date/Time details, but these
don't always match or appear accurate!?!

Is there no definitive means to finding out when a remote web page
(Internet/Intranet) was created/up-loaded other than the authors word?

Heres a random example:

On following WebPage [ http://www.toggle.org/html/0409art6.htm ] the
author has indicated that the information was published "Number 256 -
September 2004", however the Page properties say the page was Created
and Modified on "06/02/2005". If you follow the instruction within the
page and enter the Javascript into the address bar, you get the
following "01/01/1970 01:00:00" ...they can't all be right?

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default FileDateTime for Internet web page

Hi Mogwai,

Unfortunately, if you have no control over the web server, there's not much
you can do. The web server is returning the "Last-Modified" header as part
of its HTTP response. So if it's not telling the truth (or if there is some
technical reason that the file is modified often or recreated often), you'll
get useless information back.

Here's a way to request just the HTTP headers - should be pretty fast:

Public Function gsGetLastModifiedDate(rsURL As String) As String
Dim x As Object

On Error GoTo ErrHandler

Set x = CreateObject("MSXML2.XMLHTTP.5.0")

x.Open "HEAD", rsURL, False
x.send
gsGetLastModifiedDate = x.getResponseHeader("Last-Modified")

ExitRoutine:
Set x = Nothing
Exit Function
ErrHandler:
Resume ExitRoutine
End Function

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

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


Mogwai wrote:
Hi Jake,

Thanks for this.

I would be talking about a remote web page, so don't have direct
access as such.

I am trying to get the Date/Time a page was up-loaded to a web server,
as I believe this to be the most accurate Date/Time (assuming the
Server clock is correct).

I know there is Javascript, that can alert the Date/Time for a page
and the Properties of a page can also show Date/Time details, but
these don't always match or appear accurate!?!

Is there no definitive means to finding out when a remote web page
(Internet/Intranet) was created/up-loaded other than the authors word?

Heres a random example:

On following WebPage [ http://www.toggle.org/html/0409art6.htm ] the
author has indicated that the information was published "Number 256 -
September 2004", however the Page properties say the page was Created
and Modified on "06/02/2005". If you follow the instruction within the
page and enter the Javascript into the address bar, you get the
following "01/01/1970 01:00:00" ...they can't all be right?

Thanks


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
XLT and Internet Emece Excel Discussion (Misc queries) 6 April 6th 10 03:56 PM
MAKING EXCEL AS HOME PAGE IN INTERNET EXPLORER Jagz Excel Discussion (Misc queries) 4 January 2nd 05 02:51 PM
excel fit to 1 page shows 1 page but not all data is on that page Jans Excel Programming 1 September 2nd 04 01:49 AM
How do I get data from an internet page through a macro? Don Guillett[_4_] Excel Programming 0 May 14th 04 10:35 PM
How do I get data from an internet page through a macro? Gord Dibben Excel Programming 0 May 14th 04 10:28 PM


All times are GMT +1. The time now is 07:01 AM.

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"