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.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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.
 
Upvote 0

Forum statistics

Threads
1,215,543
Messages
6,125,429
Members
449,223
Latest member
Narrian

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top