Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Checking If Hyperlink Is Valid

I am trying to write a macro that will test a hyperlink, which is contained
in a cell, to a file or folder to see if the link is valid without actually
opening the file or folder. However, I'm not that familiar with VBA code
working with the Internet. So I'm at a lose as to how to proceed.

So far I have the code below, but I'm not sure what to do with it now or if
I'm really on the right track. (Assume the cell contains a link to
'file.txt' as shown on the third line.)

Sub HyperlinkTest()
Set oITC = New InetCtlsObjects.Inet
oITC.URL = "HTTP://www.abc.com/file.txt"
(don't know how to check for any errors, etc. that would tell me if the
link is valid)
End Sub

I'd appreciate any advise from someone who has had experience with this type
of situation.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Checking If Hyperlink Is Valid

I use a variation on a routine provided by Stephen Bullen to check for
bad links.

http://groups.google.com/groups?selm...&output=gplain

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
On Sat, 13 Sep 2003 13:34:43 -0700, "Steve"
wrote:

I am trying to write a macro that will test a hyperlink, which is contained
in a cell, to a file or folder to see if the link is valid without actually
opening the file or folder. However, I'm not that familiar with VBA code
working with the Internet. So I'm at a lose as to how to proceed.

So far I have the code below, but I'm not sure what to do with it now or if
I'm really on the right track. (Assume the cell contains a link to
'file.txt' as shown on the third line.)

Sub HyperlinkTest()
Set oITC = New InetCtlsObjects.Inet
oITC.URL = "HTTP://www.abc.com/file.txt"
(don't know how to check for any errors, etc. that would tell me if the
link is valid)
End Sub

I'd appreciate any advise from someone who has had experience with this type
of situation.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Checking If Hyperlink Is Valid

Thanks for the feedback, Paul. Actually, I had tried that code before, but
I always got a blank when invoking the GetHeader command even for valid
links.

Do you know if GetHeader also works with links to files and folders as well
as HTML pages? If it does, I'm not sure why I always get blanks with
GetHeader.

wrote in message
...
I use a variation on a routine provided by Stephen Bullen to check for
bad links.


http://groups.google.com/groups?selm...&output=gplain

HTH
Paul
--------------------------------------------------------------------------

------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------

------------------------------------
On Sat, 13 Sep 2003 13:34:43 -0700, "Steve"
wrote:

I am trying to write a macro that will test a hyperlink, which is

contained
in a cell, to a file or folder to see if the link is valid without

actually
opening the file or folder. However, I'm not that familiar with VBA code
working with the Internet. So I'm at a lose as to how to proceed.

So far I have the code below, but I'm not sure what to do with it now or

if
I'm really on the right track. (Assume the cell contains a link to
'file.txt' as shown on the third line.)

Sub HyperlinkTest()
Set oITC = New InetCtlsObjects.Inet
oITC.URL = "HTTP://www.abc.com/file.txt"
(don't know how to check for any errors, etc. that would tell me if

the
link is valid)
End Sub

I'd appreciate any advise from someone who has had experience with this

type
of situation.




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
checking hyperlinks are valid Rafael Guerreiro Osorio Excel Discussion (Misc queries) 2 April 4th 23 12:57 PM
checking hyperlinks are valid Garbagh Excel Discussion (Misc queries) 2 September 21st 17 05:04 PM
checking hyperlinks are valid Garbagh Excel Discussion (Misc queries) 0 November 30th 06 02:16 PM
checking hyperlinks are valid Rafael Guerreiro Osorio Excel Discussion (Misc queries) 0 November 30th 06 01:34 PM
hyperlink reference not valid Dannycol Excel Worksheet Functions 0 April 10th 06 03:36 PM


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