Object variable or With block variable not set (Error 91)

后端 未结 1 1576
离开以前
离开以前 2020-11-29 11:25

I have the following code:

Sub AddSources()
    Dim pubPage As Page
    Dim pubShape As Shape
    Dim hprlink As Hyperlink
    Dim origAddress() As String
           


        
相关标签:
1条回答
  • 2020-11-29 12:00

    As I wrote in my comment, the solution to your problem is to write the following:

    Set hyperLinkText = hprlink.Range
    

    Set is needed because TextRange is a class, so hyperLinkText is an object; as such, if you want to assign it, you need to make it point to the actual object that you need.

    0 讨论(0)
提交回复
热议问题