J
Jared
I am currently working on a project to hyperlink many bookmarked word
documents to a spreadsheet on Excel 2003. It will have probably a
hundred links. However, All of the word documents are saved on my
computer but eventually they will be saved in a different location but
with the same name. I don't want to do all of the hyperlinks until I
am sure that I will be able to change all of them without doing them
one by one again. I hyperlinked a few and then tried to use this code
to see if the hyperlinks would change anything on it:
Sub FixHiperlinks()
Dim OldStr As String, NewStr As String
OldStr = "D:\Documents and Settings"
NewStr = "Jared is the man"
Dim hyp As Hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Adress = Replace(hyp.Address, OldStr, NewStr)
Next hyp
End Sub
I know that I don't actually want to change them yet and of course I
would never change them to "Jared is the man" but I just wanted to see
if the hyperlinks would change, however, when I tried to run this code
as a macro I got a message that says,
"Object doesn't support this property or method"
I know I'm probably doing something stupid, but can anyone help me know
what I'm doing wrong?
documents to a spreadsheet on Excel 2003. It will have probably a
hundred links. However, All of the word documents are saved on my
computer but eventually they will be saved in a different location but
with the same name. I don't want to do all of the hyperlinks until I
am sure that I will be able to change all of them without doing them
one by one again. I hyperlinked a few and then tried to use this code
to see if the hyperlinks would change anything on it:
Sub FixHiperlinks()
Dim OldStr As String, NewStr As String
OldStr = "D:\Documents and Settings"
NewStr = "Jared is the man"
Dim hyp As Hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Adress = Replace(hyp.Address, OldStr, NewStr)
Next hyp
End Sub
I know that I don't actually want to change them yet and of course I
would never change them to "Jared is the man" but I just wanted to see
if the hyperlinks would change, however, when I tried to run this code
as a macro I got a message that says,
"Object doesn't support this property or method"
I know I'm probably doing something stupid, but can anyone help me know
what I'm doing wrong?