View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default ActiveWorkbook.ChangeLink

Hi again Phillip...

I just tested the code without the quotes around the range names and it
failed. If it doesn't work without the quotes, put them back in
("TextForOldLink").

--
Jay



"Jay" wrote:

Hi Phillip -

As Susan suggests, also remove the quotes from the code in my previous post.
Thanks Susan!

--
Jay

"Jay" wrote:

Hi Phillip -

Given that your original static approach worked, a small change should be
all that is necessary.

Change Worksheet.Range to ActiveSheet.Range or to Worksheets("sheetName").
In fact, it might help to restructure your code just a bit. For example:

Sub UpdateLink2()
With ActiveWorkbook
.ChangeLink _
.Worksheets("sheetName").Range("TextForOldLink").V alue, _
.Worksheets("sheetName").Range("TextForNewLink").V alue, xlExcelLinks
End With
End Sub

---
Jay