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.
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.