Worksheet.Range("TextForNewLink").Value, xlExcelLinks
try taking out the quotes............
Worksheet.Range(TextForNewLink).Value, xlExcelLinks

susan
On Apr 18, 11:10 am, Philip J Smith
<PhilipJSm...@discussions.microsoft.com> wrote:
> I have some code which updates the links for named files
>
> Sub UpdateLink1()
> ActiveWorkbook.ChangeLink _
> "\Forecasting\FY2006\1106\OpsPlan\1106JudgementPaperLinksv003.xls", _
> "\Forecasting\FY2007\0307\OpsPlan\0307JudgementPaperLinksv001.xls",
> xlExcelLinks
> End Sub
>
> I want to make the macro dynamic so that it picks up these filenames from
> named ranges TextForOldLink and TextForNewLink.
>
> I tried the following substitution but it didn't work
>
> Sub UpdateLink2()
> ActiveWorkbook.ChangeLink _
> Worksheet.Range("TextForOldLink").Value, _
> Worksheet.Range("TextForNewLink").Value, xlExcelLinks
> End Sub
>
> Can anyone tell me please, how do I use the contents of Named Ranges in VBA
> Code?
>
> In this case the contents are lables.
>
> Regards