Method 'ChangeLink' of object '_Workbook' Failed

Andrew_Kenya

New Member
Joined
Sep 13, 2012
Messages
5
Hello,

I keep getting the above debug error that I unable to fix. I am using some code to Change Links in Excel 2007. However the link I am trying to change is to an excel 2003 workbook. Code is below I am sure there is a smarter way to paste code but I don't know it yet.

''Successful change link'
ChDir _
Productdir & country & "\DTR " & country & "\" & Month1 & " " & yy & "\Market Risk Reports " & dd & "-" & mm & "-" & yy
ActiveWorkbook.ChangeLink Name:= _
Productdir & country & "\DTR " & country & "\" & Monthp & " " & yyp & "\Market Risk Reports " & ddp & "-" & mmp & "-" & yyp & "\PL Total - Summary " & ddp & "-" & mmp & "-" & yyp & ".xlsx" _
, NewName:= _
Productdir & country & "\DTR " & country & "\" & Month1 & " " & yy & "\Market Risk Reports " & dd & "-" & mm & "-" & yy & "\PL Total - Summary " & dd & "-" & mm & "-" & yy & ".xlsx" _
, Type:=xlExcelLinks

''Unsuccessful Change Link


ChDir _
Productdir & country & "\DTR " & country & "\" & Month1 & " " & yy & "\Market Risk Reports " & dd & "-" & mm & "-" & yy
ActiveWorkbook.ChangeLink Name:= _
Productdir & country & "\DTR " & country & "\" & Monthp & " " & yyp & "\Market Risk Reports " & ddp & "-" & mmp & "-" & yyp & "\Reval Rates " & ddp & "-" & mmp & "-" & yyp & ".xls" _
, NewName:= _
Productdir & country & "\DTR " & country & "\" & Month1 & " " & yy & "\Market Risk Reports " & dd & "-" & mm & "-" & yy & "\Reval Rates " & dd & "-" & mm & "-" & yy & ".xls" _
, Type:=xlExcelLinks

If anyone knows why xls won't update with the same method as xlsx I would be appreciative.
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Andrew_Kenya

New Member
Joined
Sep 13, 2012
Messages
5
Figured it out it had nothing to do with the excel versionthe original link was in error so the change wasn't working because it was trying to change a link that never existed in the first place.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,877
Messages
5,574,770
Members
412,617
Latest member
mlharris
Top