Hi there!
I ended up getting the code working like you said using :
MyXL.ActiveSheet.Range("A6").Select
MyXL.ActiveSheet.Hyperlinks.Add Anchor:=MyXL.ActiveSheet.Range("A6")., Address:= _
myString, _
TextToDisplay:=myString
However, I then tried to expand the code so that rather than always placing the hyperlink in A6, It looked for the next blank cell in Column A and added the hyperlink there.
Remembering that this Macro is embedded in the Word document, I came up with the following (But it doesn't work):
Set MyXL = GetObject("M:\Mission Systems Controlled Docs\EW Specifications Documents Register.xls")
MyXL.Application.Visible = True
MyXL.Parent.Windows(1).Visible = True
'Adds Hyperlinks
MyXL.Activate
Row_Num = MyXL.ActiveSheet.Range("A65536").End(xlUp).Row + 1 'Determines next blank row
Ref_cell = "A" & Row_Num
MyXL.ActiveSheet.Range(Ref_cell).Select
MyXL.ActiveSheet.Hyperlinks.Add Anchor:=MyXL.ActiveSheet.Range(Ref_cell), Address:= _
myString, _
TextToDisplay:=myString
But it doesn't like the line :
Row_Num = MyXL.ActiveSheet.Range("A65536").End(xlUp).Row + 1 'Determines next blank row
Any ideas?
Bookmarks