相关疑难解决方法(0)

使用VBA在Excel中对死去的超链接进行排序?

标题说:

我有一个excel Sheet,其中包含一个包含超链接的列.现在我想要一个VBA脚本检查哪些超链接已经死亡或工作,并使用文本404错误或活动进入下一列.

希望有人可以帮助我,因为我不擅长VB.

编辑:

我发现@ http://www.utteraccess.com/forums/printthread.php?Cat=&Board=84&main=1037294&type=thread

一个解决方案是单词,但问题是我需要这个Excel的解决方案.有人可以将此转换为Excel解决方案吗?

Private Sub testHyperlinks()
    Dim thisHyperlink As Hyperlink
    For Each thisHyperlink In ActiveDocument.Hyperlinks
        If thisHyperlink.Address <> "" And Left(thisHyperlink.Address, 6) <> "mailto" Then
            If Not IsURLGood(thisHyperlink.Address) Then
                Debug.Print thisHyperlink.Address
            End If
        End If
    Next
End Sub


Private Function IsURLGood(url As String) As Boolean
    ' Test the URL to see if it is good
    Dim request As New WinHttpRequest

    On Error GoTo IsURLGoodError
    request.Open "GET", url
    request.Send
    If request.Status = 200 Then
        IsURLGood = …
Run Code Online (Sandbox Code Playgroud)

sorting excel vba hyperlink

4
推荐指数
2
解决办法
3万
查看次数

标签 统计

excel ×1

hyperlink ×1

sorting ×1

vba ×1