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.
 

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.
 

Forum statistics

Threads
1,081,516
Messages
5,359,232
Members
400,523
Latest member
ExcelNewbie98

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top